75 references to CastExpression
Microsoft.CodeAnalysis.CSharp (7)
Binder\Binder_Expressions.cs (2)
595
case SyntaxKind.
CastExpression
:
2741
case SyntaxKind.
CastExpression
:
Binder\EarlyWellKnownAttributeBinder.cs (1)
105
case SyntaxKind.
CastExpression
:
Parser\LanguageParser.cs (1)
10146
case SyntaxKind.
CastExpression
:
Syntax\SyntaxFacts.cs (2)
113
case
CastExpression
:
348
while (current != null && (current.IsKind(ParenthesizedExpression) || current.IsKind(
CastExpression
))) current = current.Parent;
Syntax\SyntaxNodeExtensions.cs (1)
150
if (node.Parent.IsKind(SyntaxKind.
CastExpression
))
Microsoft.CodeAnalysis.CSharp.CodeStyle (14)
CastSimplifier.cs (1)
832
=> node is ExpressionSyntax expression && expression.WalkDownParentheses().Kind() is SyntaxKind.
CastExpression
or SyntaxKind.AsExpression;
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
121
case SyntaxKind.
CastExpression
:
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
187
if (!declaratorValue.IsKind(SyntaxKind.
CastExpression
, out castExpression))
CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
24
ImmutableArray.Create(SyntaxKind.
CastExpression
, SyntaxKind.AsExpression);
ExpressionSyntaxExtensions.cs (1)
743
case SyntaxKind.
CastExpression
:
ParenthesizedExpressionSyntaxExtensions.cs (5)
169
if (nodeParent.IsKind(SyntaxKind.
CastExpression
) && expression.IsKind(SyntaxKind.ThisExpression))
271
if (parentExpression.IsKind(SyntaxKind.
CastExpression
))
574
binaryExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.
CastExpression
)
635
|| lessThanExpression.Left.IsKind(SyntaxKind.
CastExpression
))
670
&& greaterThanExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.
CastExpression
;
SpacingFormattingRule.cs (3)
172
if ((previousParentKind == SyntaxKind.
CastExpression
&& previousKind == SyntaxKind.OpenParenToken) ||
173
(currentParentKind == SyntaxKind.
CastExpression
&& currentKind == SyntaxKind.CloseParenToken))
204
if (previousParentKind == SyntaxKind.
CastExpression
&& previousKind == SyntaxKind.CloseParenToken)
TypeStyleHelper.cs (1)
87
if (initializerExpression.IsKind(SyntaxKind.
CastExpression
) ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
273
if (token.Parent.IsKind(SyntaxKind.
CastExpression
))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (3)
1233
if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.
CastExpression
))
1561
SyntaxKind.
CastExpression
))
2040
token.Parent.IsKind(SyntaxKind.
CastExpression
))
Microsoft.CodeAnalysis.CSharp.Features (11)
CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
44
node.IsKind(SyntaxKind.
CastExpression
) ||
CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
78
node.IsKind(SyntaxKind.
CastExpression
) ||
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
251
if (node.IsParentKind(SyntaxKind.
CastExpression
))
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
439
while (parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.
CastExpression
)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
159
token.GetRequiredParent().Kind() == SyntaxKind.
CastExpression
)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
77
if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.
CastExpression
))
ConvertCast\CSharpConvertDirectCastToTryCastCodeRefactoringProvider.cs (1)
35
protected override int FromKind => (int)SyntaxKind.
CastExpression
;
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
121
case SyntaxKind.
CastExpression
:
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
187
if (!declaratorValue.IsKind(SyntaxKind.
CastExpression
, out castExpression))
CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
24
ImmutableArray.Create(SyntaxKind.
CastExpression
, SyntaxKind.AsExpression);
Debugging\CSharpProximityExpressionsService_ExpressionTermCollector.cs (1)
89
case SyntaxKind.
CastExpression
:
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\StackAllocInitializerTests.cs (1)
1138
Assert.Equal(SyntaxKind.
CastExpression
, obj1.Initializer.Value.Kind());
Semantics\StackAllocSpanExpressionsTests.cs (1)
132
Assert.Equal(SyntaxKind.
CastExpression
, obj1.Initializer.Value.Kind());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (16)
Parsing\DeconstructionTests.cs (1)
1954
Assert.Equal(SyntaxKind.
CastExpression
, lhsContent.Expression.Kind());
Parsing\ExpressionParsingTests.cs (1)
931
Assert.Equal(SyntaxKind.
CastExpression
, expr.Kind());
Parsing\FunctionPointerTests.cs (2)
1833
N(SyntaxKind.
CastExpression
);
1940
N(SyntaxKind.
CastExpression
);
Parsing\NullableParsingTests.cs (3)
99
N(SyntaxKind.
CastExpression
);
222
N(SyntaxKind.
CastExpression
);
275
N(SyntaxKind.
CastExpression
);
Parsing\PatternParsingTests.cs (8)
7762
N(SyntaxKind.
CastExpression
);
7788
N(SyntaxKind.
CastExpression
);
10575
N(SyntaxKind.
CastExpression
);
10813
N(SyntaxKind.
CastExpression
);
10866
N(SyntaxKind.
CastExpression
);
10917
N(SyntaxKind.
CastExpression
);
10974
N(SyntaxKind.
CastExpression
);
11191
N(SyntaxKind.
CastExpression
);
Parsing\StatementAttributeParsingTests.cs (1)
4476
N(SyntaxKind.
CastExpression
);
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
CastSimplifier.cs (1)
832
=> node is ExpressionSyntax expression && expression.WalkDownParentheses().Kind() is SyntaxKind.
CastExpression
or SyntaxKind.AsExpression;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (1)
743
case SyntaxKind.
CastExpression
:
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
273
if (token.Parent.IsKind(SyntaxKind.
CastExpression
))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (3)
1233
if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.
CastExpression
))
1561
SyntaxKind.
CastExpression
))
2040
token.Parent.IsKind(SyntaxKind.
CastExpression
))
ParenthesizedExpressionSyntaxExtensions.cs (5)
169
if (nodeParent.IsKind(SyntaxKind.
CastExpression
) && expression.IsKind(SyntaxKind.ThisExpression))
271
if (parentExpression.IsKind(SyntaxKind.
CastExpression
))
574
binaryExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.
CastExpression
)
635
|| lessThanExpression.Left.IsKind(SyntaxKind.
CastExpression
))
670
&& greaterThanExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.
CastExpression
;
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (4)
37
if ((node.Left.IsKind(SyntaxKind.
CastExpression
) && !reducedNode.Left.IsKind(SyntaxKind.
CastExpression
)) ||
38
(node.Right.IsKind(SyntaxKind.
CastExpression
) && !reducedNode.Right.IsKind(SyntaxKind.
CastExpression
)))
Simplification\Simplifiers\NameSimplifier.cs (1)
649
if (!reparsedCastExpression.IsKind(SyntaxKind.
CastExpression
))
SpacingFormattingRule.cs (3)
172
if ((previousParentKind == SyntaxKind.
CastExpression
&& previousKind == SyntaxKind.OpenParenToken) ||
173
(currentParentKind == SyntaxKind.
CastExpression
&& currentKind == SyntaxKind.CloseParenToken))
204
if (previousParentKind == SyntaxKind.
CastExpression
&& previousKind == SyntaxKind.CloseParenToken)
TypeStyleHelper.cs (1)
87
if (initializerExpression.IsKind(SyntaxKind.
CastExpression
) ||
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
192
case SyntaxKind.
CastExpression
: