53 references to AsExpression
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Expressions.cs (1)
667case SyntaxKind.AsExpression:
Parser\LanguageParser.cs (2)
10794case SyntaxKind.AsExpression: 11127if (operatorExpressionKind == SyntaxKind.AsExpression)
Syntax\SyntaxFacts.cs (1)
137case AsExpression:
Syntax\SyntaxKindFacts.cs (1)
626return SyntaxKind.AsExpression;
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs (1)
47SyntaxKind.AsExpression,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
24[SyntaxKind.CastExpression, SyntaxKind.AsExpression];
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
49context.RegisterSyntaxNodeAction(context => AnalyzeAsExpression(context), SyntaxKind.AsExpression);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
286if (!initializerValue.IsKind(SyntaxKind.AsExpression, out asExpression)) 297if (!assignment.Right.IsKind(SyntaxKind.AsExpression, out asExpression) ||
src\Analyzers\CSharp\Analyzers\UsePatternMatching\UsePatternMatchingHelpers.cs (1)
26if (asExpression.Kind() == SyntaxKind.AsExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
88if (initializerExpression.Kind() is SyntaxKind.CastExpression or SyntaxKind.IsExpression or SyntaxKind.AsExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
559case SyntaxKind.AsExpression: 770case SyntaxKind.AsExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
55return cast.Kind() == SyntaxKind.AsExpression && 979=> node is ExpressionSyntax expression && expression.WalkDownParentheses().Kind() is SyntaxKind.CastExpression or SyntaxKind.AsExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
673if (binaryExpression.Kind() is SyntaxKind.AsExpression or SyntaxKind.IsExpression &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
318SyntaxKind.AsExpression or
Microsoft.CodeAnalysis.CSharp.Features (11)
ConvertCast\CSharpConvertDirectCastToTryCastCodeRefactoringProvider.cs (1)
63var asExpression = BinaryExpression(SyntaxKind.AsExpression, expression, typeNode)
ConvertCast\CSharpConvertTryCastToDirectCastCodeRefactoringProvider.cs (1)
37protected override int FromKind => (int)SyntaxKind.AsExpression;
Debugging\CSharpProximityExpressionsService_ExpressionTermCollector.cs (1)
373case SyntaxKind.AsExpression:
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (1)
57if (annotatedexpressionSyntax.Kind() is SyntaxKind.IsExpression or SyntaxKind.AsExpression)
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs (1)
47SyntaxKind.AsExpression,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
24[SyntaxKind.CastExpression, SyntaxKind.AsExpression];
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
49context.RegisterSyntaxNodeAction(context => AnalyzeAsExpression(context), SyntaxKind.AsExpression);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
286if (!initializerValue.IsKind(SyntaxKind.AsExpression, out asExpression)) 297if (!assignment.Right.IsKind(SyntaxKind.AsExpression, out asExpression) ||
src\Analyzers\CSharp\Analyzers\UsePatternMatching\UsePatternMatchingHelpers.cs (1)
26if (asExpression.Kind() == SyntaxKind.AsExpression)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
318SyntaxKind.AsExpression or
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
IncrementalParsing\BinaryExpression.cs (2)
144MakeBinOpChange(SyntaxKind.AddExpression, SyntaxKind.AsExpression); 265case SyntaxKind.AsExpression:
Parsing\FunctionPointerTests.cs (1)
1887N(SyntaxKind.AsExpression);
Parsing\LambdaAttributeParsingTests.cs (5)
1456N(SyntaxKind.AsExpression); 2522N(SyntaxKind.AsExpression); 2559N(SyntaxKind.AsExpression); 2604N(SyntaxKind.AsExpression); 2643N(SyntaxKind.AsExpression);
Parsing\NullableParsingTests.cs (5)
498N(SyntaxKind.AsExpression); 525N(SyntaxKind.AsExpression); 567N(SyntaxKind.AsExpression); 605N(SyntaxKind.AsExpression); 644N(SyntaxKind.AsExpression);
Parsing\PatternParsingTests.cs (1)
411N(SyntaxKind.AsExpression);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3271=> SyntaxFactory.BinaryExpression(SyntaxKind.AsExpression, (ExpressionSyntax)Parenthesize(expression), (TypeSyntax)type);
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
206var isOrAsNode = node.Kind() is SyntaxKind.AsExpression or SyntaxKind.IsExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
88if (initializerExpression.Kind() is SyntaxKind.CastExpression or SyntaxKind.IsExpression or SyntaxKind.AsExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
559case SyntaxKind.AsExpression: 770case SyntaxKind.AsExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
55return cast.Kind() == SyntaxKind.AsExpression && 979=> node is ExpressionSyntax expression && expression.WalkDownParentheses().Kind() is SyntaxKind.CastExpression or SyntaxKind.AsExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
673if (binaryExpression.Kind() is SyntaxKind.AsExpression or SyntaxKind.IsExpression &&
Microsoft.Maui.Controls.BindingSourceGen (2)
BindingSourceGenerator.cs (1)
223 BinaryExpressionSyntax binary when binary.Kind() == SyntaxKind.AsExpression => binary.Left,
PathParser.cs (1)
29 BinaryExpressionSyntax asExpression when asExpression.Kind() == SyntaxKind.AsExpression => HandleBinaryExpression(asExpression),