110 references to CastExpression
Microsoft.CodeAnalysis.CSharp (7)
Binder\Binder_Expressions.cs (2)
627case SyntaxKind.CastExpression: 2957case SyntaxKind.CastExpression:
Binder\EarlyWellKnownAttributeBinder.cs (1)
105case SyntaxKind.CastExpression:
Parser\LanguageParser.cs (1)
10762case 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)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
24[SyntaxKind.CastExpression, SyntaxKind.AsExpression];
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
121case SyntaxKind.CastExpression:
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
198if (!declaratorValue.IsKind(SyntaxKind.CastExpression, out castExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
87if (initializerExpression.Kind() is SyntaxKind.CastExpression or SyntaxKind.IsExpression or SyntaxKind.AsExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
725case SyntaxKind.CastExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (5)
163if (nodeParent.IsKind(SyntaxKind.CastExpression) && expression.IsKind(SyntaxKind.ThisExpression)) 271if (parentExpression.IsKind(SyntaxKind.CastExpression) && 563binaryExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression) 624|| lessThanExpression.Left.IsKind(SyntaxKind.CastExpression)) 659&& greaterThanExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (3)
170if ((previousParentKind == SyntaxKind.CastExpression && previousKind == SyntaxKind.OpenParenToken) || 171(currentParentKind == SyntaxKind.CastExpression && currentKind == SyntaxKind.CloseParenToken)) 202if (previousParentKind == SyntaxKind.CastExpression && previousKind == SyntaxKind.CloseParenToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
941=> node is ExpressionSyntax expression && expression.WalkDownParentheses().Kind() is SyntaxKind.CastExpression or SyntaxKind.AsExpression;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
41or SyntaxKind.CastExpression ||
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
60or SyntaxKind.CastExpression ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
274if (token.Parent.IsKind(SyntaxKind.CastExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
1247if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.CastExpression)) 1577SyntaxKind.CastExpression)) 2049token.Parent.IsKind(SyntaxKind.CastExpression))
Microsoft.CodeAnalysis.CSharp.Features (11)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
243if (node.IsParentKind(SyntaxKind.CastExpression))
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
437while (parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
156token.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;
Debugging\CSharpProximityExpressionsService_ExpressionTermCollector.cs (1)
89case SyntaxKind.CastExpression:
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
24[SyntaxKind.CastExpression, SyntaxKind.AsExpression];
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
121case SyntaxKind.CastExpression:
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
198if (!declaratorValue.IsKind(SyntaxKind.CastExpression, out castExpression))
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
41or SyntaxKind.CastExpression ||
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
60or SyntaxKind.CastExpression ||
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\StackAllocInitializerTests.cs (1)
1154Assert.Equal(SyntaxKind.CastExpression, obj1.Initializer.Value.Kind());
Semantics\StackAllocSpanExpressionsTests.cs (1)
132Assert.Equal(SyntaxKind.CastExpression, obj1.Initializer.Value.Kind());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (49)
Parsing\CollectionExpressionParsingTests.cs (22)
3882N(SyntaxKind.CastExpression); 3936N(SyntaxKind.CastExpression); 3998N(SyntaxKind.CastExpression); 4172N(SyntaxKind.CastExpression); 4230N(SyntaxKind.CastExpression); 4287N(SyntaxKind.CastExpression); 4408N(SyntaxKind.CastExpression); 4522N(SyntaxKind.CastExpression); 4583N(SyntaxKind.CastExpression); 4645N(SyntaxKind.CastExpression); 4695N(SyntaxKind.CastExpression); 5060N(SyntaxKind.CastExpression); 5122N(SyntaxKind.CastExpression); 5192N(SyntaxKind.CastExpression); 5233N(SyntaxKind.CastExpression); 5381N(SyntaxKind.CastExpression); 5415N(SyntaxKind.CastExpression); 5518N(SyntaxKind.CastExpression); 5549N(SyntaxKind.CastExpression); 5585N(SyntaxKind.CastExpression); 5654N(SyntaxKind.CastExpression); 5715N(SyntaxKind.CastExpression);
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\MemberDeclarationParsingTests.cs (8)
16221N(SyntaxKind.CastExpression); 16258N(SyntaxKind.CastExpression); 16374N(SyntaxKind.CastExpression); 16413N(SyntaxKind.CastExpression); 16787N(SyntaxKind.CastExpression); 16834N(SyntaxKind.CastExpression); 16968N(SyntaxKind.CastExpression); 17017N(SyntaxKind.CastExpression);
Parsing\NullableParsingTests.cs (3)
99N(SyntaxKind.CastExpression); 222N(SyntaxKind.CastExpression); 275N(SyntaxKind.CastExpression);
Parsing\PatternParsingTests.cs (8)
7723N(SyntaxKind.CastExpression); 7749N(SyntaxKind.CastExpression); 10536N(SyntaxKind.CastExpression); 10774N(SyntaxKind.CastExpression); 10827N(SyntaxKind.CastExpression); 10878N(SyntaxKind.CastExpression); 10935N(SyntaxKind.CastExpression); 11152N(SyntaxKind.CastExpression);
Parsing\RangeExpressionParsingTests.cs (3)
18N(SyntaxKind.CastExpression); 39N(SyntaxKind.CastExpression); 239N(SyntaxKind.CastExpression);
Parsing\StatementAttributeParsingTests.cs (1)
4477N(SyntaxKind.CastExpression);
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
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)
669if (!reparsedCastExpression.IsKind(SyntaxKind.CastExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
87if (initializerExpression.Kind() is SyntaxKind.CastExpression or SyntaxKind.IsExpression or SyntaxKind.AsExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
725case SyntaxKind.CastExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (5)
163if (nodeParent.IsKind(SyntaxKind.CastExpression) && expression.IsKind(SyntaxKind.ThisExpression)) 271if (parentExpression.IsKind(SyntaxKind.CastExpression) && 563binaryExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression) 624|| lessThanExpression.Left.IsKind(SyntaxKind.CastExpression)) 659&& greaterThanExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (3)
170if ((previousParentKind == SyntaxKind.CastExpression && previousKind == SyntaxKind.OpenParenToken) || 171(currentParentKind == SyntaxKind.CastExpression && currentKind == SyntaxKind.CloseParenToken)) 202if (previousParentKind == SyntaxKind.CastExpression && previousKind == SyntaxKind.CloseParenToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
941=> node is ExpressionSyntax expression && expression.WalkDownParentheses().Kind() is SyntaxKind.CastExpression or SyntaxKind.AsExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
274if (token.Parent.IsKind(SyntaxKind.CastExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (3)
1247if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.CastExpression)) 1577SyntaxKind.CastExpression)) 2049token.Parent.IsKind(SyntaxKind.CastExpression))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
192case SyntaxKind.CastExpression: