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