private static bool removeNullable(CsExpression expr) { var bin = expr as CsBinaryOperatorExpression; var typeOp = expr as CsBinaryTypeOperatorExpression; if (bin != null) { var result = removeNullable(bin.Right); if (result) bin.EndIndex = bin.Right.EndIndex; return result; } else if (typeOp != null) { var nullable = typeOp.Right as CsNullableTypeName; if (typeOp.Operator == BinaryTypeOperator.Is && nullable != null) { typeOp.Right = nullable.InnerType; typeOp.EndIndex = nullable.InnerType.EndIndex; return true; } } return false; }
internal static ResolveContext ToResolveContext(CsExpression expr, NameResolver resolver, bool isChecked) { return expr.ToResolveContext(resolver, isChecked); }