72 references to Type
Microsoft.CodeAnalysis.CSharp (17)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1906=> node.Update(VisitList(node.AttributeLists), VisitToken(node.AwaitKeyword), VisitToken(node.ForEachKeyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression"), VisitToken(node.CloseParenToken), (StatementSyntax?)Visit(node.Statement) ?? throw new ArgumentNullException("statement"));
_generated\2\Syntax.xml.Syntax.Generated.cs (10)
7833if (attributeLists != this.AttributeLists || awaitKeyword != this.AwaitKeyword || forEachKeyword != this.ForEachKeyword || openParenToken != this.OpenParenToken || type != this.Type || identifier != this.Identifier || inKeyword != this.InKeyword || expression != this.Expression || closeParenToken != this.CloseParenToken || statement != this.Statement) 7844public new ForEachStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 7846public new ForEachStatementSyntax WithAwaitKeyword(SyntaxToken awaitKeyword) => Update(this.AttributeLists, awaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 7848public new ForEachStatementSyntax WithForEachKeyword(SyntaxToken forEachKeyword) => Update(this.AttributeLists, this.AwaitKeyword, forEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 7850public new ForEachStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, openParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 7852public ForEachStatementSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 7854public new ForEachStatementSyntax WithInKeyword(SyntaxToken inKeyword) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, inKeyword, this.Expression, this.CloseParenToken, this.Statement); 7856public new ForEachStatementSyntax WithExpression(ExpressionSyntax expression) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, expression, this.CloseParenToken, this.Statement); 7858public new ForEachStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, closeParenToken, this.Statement); 7860public new ForEachStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, statement);
Binder\ForEachLoopBinder.cs (3)
91syntax.Type, 290TypeSyntax typeSyntax = node.Type; 1301((syntax as ForEachStatementSyntax)?.Type.IsVar == true) ?
FlowAnalysis\NullableWalker.cs (1)
12554ReportNullabilityMismatchInAssignment(foreachSyntax.Type, sourceType, destinationType);
Lowering\Instrumentation\DebugInfoInjector.cs (1)
319iterationVarDeclSpan = TextSpan.FromBounds(forEachSyntax.Type.SpanStart, forEachSyntax.Identifier.Span.End);
Syntax\SyntaxFacts.cs (1)
132return ((ForEachStatementSyntax)parent).Type == node;
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
104forEachStatement.Type == unusedDefinition.Syntax)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
31needsCast = !foreachStatement.Type.IsVar && foreachInfo.ElementConversion.IsExplicit;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
130semanticModel, local, forEachStatement.Type, forEachStatement.Identifier, elementConversion,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
657ForEachStatementSyntax foreachStatement => foreachStatement.Type.IsTypeInferred(semanticModel),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
69? forEachStatement.Type
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
159ForEachStatementSyntax forEach => forEach.Type,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
49if (!forEachStatement.Type.StripRefIfNeeded().IsVar) 97foreachStatement.Type == typeName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
61var type = forEachStatement.Type.StripRefIfNeeded(); 131foreachStatement.Type == typeName)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
553TypeArgumentList([foreachStatement.Type.WithoutTrivia()]))))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
123CreateTupleOrDeclarationExpression(tupleType, forEachStatement.Type),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
122forEach.Type,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1656@foreach.Type is IdentifierNameSyntax identifierName &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1338var variableTypes = GetTypes(forEachStatementSyntax.Type).ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Features (21)
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
110foreachStatement2.Type == type)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
485f is ForEachStatementSyntax forEachStatement ? forEachStatement.Type :
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (5)
106type: forEachStatement.Type.IsVar ? null : forEachStatement.Type, 107identifier: forEachStatement.Type.IsVar 109SyntaxNodeOrTokenExtensions.GetTrivia(forEachStatement.Type.GetFirstToken()) 168SyntaxNodeOrTokenExtensions.GetTrivia(forEachStatement.Type.GetFirstToken()).FilterComments(addElasticMarker: false))),
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
664var forEachStatementTypeSymbolType = _semanticModel.GetTypeInfo(forEachStatement.Type, _cancellationToken).Type; 695forEachStatement.Type,
EditAndContinue\BreakpointSpans.cs (1)
678return CreateSpan(simpleForEachStatement.Type, simpleForEachStatement.Identifier);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
327ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Type.SpanStart, node.Identifier.Span.End), 882case SyntaxKind.ForEachStatement: return AreEquivalentIgnoringLambdaBodies(((ForEachStatementSyntax)oldNode).Type, ((ForEachStatementSyntax)newNode).Type);
InlineHints\CSharpInlineTypeHintsService.cs (2)
62else if (node is ForEachStatementSyntax { Type.IsVar: true } forEachStatement) 67return CreateTypeHint(type, forEachStatement.Type, forEachStatement.Identifier);
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
104forEachStatement.Type == unusedDefinition.Syntax)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
31needsCast = !foreachStatement.Type.IsVar && foreachInfo.ElementConversion.IsExplicit;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
130semanticModel, local, forEachStatement.Type, forEachStatement.Identifier, elementConversion,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
553TypeArgumentList([foreachStatement.Type.WithoutTrivia()]))))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
123CreateTupleOrDeclarationExpression(tupleType, forEachStatement.Type),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
122forEach.Type,
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
277name.CheckParent<ForEachStatementSyntax>(f => f.Type == name) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
657ForEachStatementSyntax foreachStatement => foreachStatement.Type.IsTypeInferred(semanticModel),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
69? forEachStatement.Type
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
159ForEachStatementSyntax forEach => forEach.Type,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
49if (!forEachStatement.Type.StripRefIfNeeded().IsVar) 97foreachStatement.Type == typeName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
61var type = forEachStatement.Type.StripRefIfNeeded(); 131foreachStatement.Type == typeName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1656@foreach.Type is IdentifierNameSyntax identifierName &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1338var variableTypes = GetTypes(forEachStatementSyntax.Type).ToImmutableArray();
Roslyn.Diagnostics.CSharp.Analyzers (9)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
657ForEachStatementSyntax foreachStatement => foreachStatement.Type.IsTypeInferred(semanticModel),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
69? forEachStatement.Type
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
159ForEachStatementSyntax forEach => forEach.Type,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
49if (!forEachStatement.Type.StripRefIfNeeded().IsVar) 97foreachStatement.Type == typeName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
61var type = forEachStatement.Type.StripRefIfNeeded(); 131foreachStatement.Type == typeName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1656@foreach.Type is IdentifierNameSyntax identifierName &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1338var variableTypes = GetTypes(forEachStatementSyntax.Type).ToImmutableArray();