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