89 references to Type
Microsoft.CodeAnalysis.CSharp (17)
Binder\ForEachLoopBinder.cs (3)
91
syntax.
Type
,
290
TypeSyntax typeSyntax = node.
Type
;
1316
((syntax as ForEachStatementSyntax)?.
Type
.IsVar == true) ?
FlowAnalysis\NullableWalker.cs (1)
11924
ReportNullabilityMismatchInAssignment(foreachSyntax.
Type
, sourceType, destinationType);
Lowering\Instrumentation\DebugInfoInjector.cs (1)
319
iterationVarDeclSpan = TextSpan.FromBounds(forEachSyntax.
Type
.SpanStart, forEachSyntax.Identifier.Span.End);
Syntax.xml.Main.Generated.cs (1)
1894
=> 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"));
Syntax.xml.Syntax.Generated.cs (10)
7787
if (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)
7798
public 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);
7800
public 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);
7802
public 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);
7804
public 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);
7806
public ForEachStatementSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.
Type
, identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement);
7808
public 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);
7810
public 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);
7812
public 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);
7814
public 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);
Syntax\SyntaxFacts.cs (1)
132
return ((ForEachStatementSyntax)parent).
Type
== node;
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
104
forEachStatement.
Type
== unusedDefinition.Syntax)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
130
semanticModel, local, forEachStatement.
Type
, forEachStatement.Identifier, elementConversion,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
657
ForEachStatementSyntax foreachStatement => foreachStatement.
Type
.IsTypeInferred(semanticModel),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
91
? forEachStatement.
Type
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
143
ForEachStatementSyntax forEach => forEach.
Type
,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
55
if (!forEachStatement.
Type
.StripRefIfNeeded().IsVar)
104
foreachStatement.
Type
== typeName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
61
var type = forEachStatement.
Type
.StripRefIfNeeded();
143
foreachStatement.
Type
== typeName)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
124
CreateTupleOrDeclarationExpression(tupleType, forEachStatement.
Type
),
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
116
forEach.
Type
,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1656
@foreach.
Type
is IdentifierNameSyntax identifierName &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1263
var variableTypes = GetTypes(forEachStatementSyntax.
Type
);
Microsoft.CodeAnalysis.CSharp.Features (19)
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
110
foreachStatement2.
Type
== type)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
414
f is ForEachStatementSyntax forEachStatement ? forEachStatement.
Type
:
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (5)
106
type: forEachStatement.
Type
.IsVar ? null : forEachStatement.
Type
,
107
identifier: forEachStatement.
Type
.IsVar
109
SyntaxNodeOrTokenExtensions.GetTrivia(forEachStatement.
Type
.GetFirstToken())
168
SyntaxNodeOrTokenExtensions.GetTrivia(forEachStatement.
Type
.GetFirstToken())
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
664
var forEachStatementTypeSymbolType = _semanticModel.GetTypeInfo(forEachStatement.
Type
, _cancellationToken).Type;
695
forEachStatement.
Type
,
EditAndContinue\BreakpointSpans.cs (1)
678
return CreateSpan(simpleForEachStatement.
Type
, simpleForEachStatement.Identifier);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
327
ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.
Type
.SpanStart, node.Identifier.Span.End),
882
case SyntaxKind.ForEachStatement: return AreEquivalentIgnoringLambdaBodies(((ForEachStatementSyntax)oldNode).
Type
, ((ForEachStatementSyntax)newNode).
Type
);
InlineHints\CSharpInlineTypeHintsService.cs (2)
62
else if (node is ForEachStatementSyntax {
Type
.IsVar: true } forEachStatement)
67
return CreateTypeHint(type, forEachStatement.
Type
, forEachStatement.Identifier);
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
104
forEachStatement.
Type
== unusedDefinition.Syntax)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
130
semanticModel, local, forEachStatement.
Type
, forEachStatement.Identifier, elementConversion,
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
124
CreateTupleOrDeclarationExpression(tupleType, forEachStatement.
Type
),
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
116
forEach.
Type
,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\ForEachTests.cs (3)
2143
var typeInfo = model.GetTypeInfo(loopSyntax.
Type
);
2147
var conv = model.GetConversion(loopSyntax.
Type
);
2894
var varSyntax = foreachSyntax.
Type
;
Semantics\NullableReferenceTypesTests.cs (2)
10536
var type1 = foreachSyntax[0].
Type
;
10540
var type2 = foreachSyntax[1].
Type
;
Semantics\RefFieldTests.cs (2)
14674
var type = decl.
Type
;
15213
var type = decl.
Type
;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
2466
var typeInfo = model.GetTypeInfoAndVerifyIOperation(foreachStatement.
Type
);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (12)
Generated\Syntax.Test.xml.Generated.cs (2)
12665
Assert.NotNull(node.
Type
);
12671
var newNode = node.WithAttributeLists(node.AttributeLists).WithAwaitKeyword(node.AwaitKeyword).WithForEachKeyword(node.ForEachKeyword).WithOpenParenToken(node.OpenParenToken).WithType(node.
Type
).WithIdentifier(node.Identifier).WithInKeyword(node.InKeyword).WithExpression(node.Expression).WithCloseParenToken(node.CloseParenToken).WithStatement(node.Statement);
Parsing\StatementParsingTests.cs (10)
1934
Assert.NotNull(fs.
Type
);
1935
Assert.Equal("T", fs.
Type
.ToString());
1967
Assert.NotNull(fs.
Type
);
1968
Assert.Equal("T", fs.
Type
.ToString());
1996
Assert.NotNull(fs.
Type
);
1997
Assert.Equal("var", fs.
Type
.ToString());
1998
Assert.Equal(SyntaxKind.IdentifierName, fs.
Type
.Kind());
1999
Assert.Equal(SyntaxKind.IdentifierToken, ((IdentifierNameSyntax)fs.
Type
).Identifier.Kind());
3382
Assert.NotNull(fs.
Type
);
3383
Assert.Equal("T", fs.
Type
.ToString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
371
(expression.Parent is ForEachStatementSyntax forEach && forEach.
Type
== expression) ||
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
277
name.CheckParent<ForEachStatementSyntax>(f => f.
Type
== name) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
657
ForEachStatementSyntax foreachStatement => foreachStatement.
Type
.IsTypeInferred(semanticModel),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
91
? forEachStatement.
Type
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
143
ForEachStatementSyntax forEach => forEach.
Type
,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
55
if (!forEachStatement.
Type
.StripRefIfNeeded().IsVar)
104
foreachStatement.
Type
== typeName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
61
var type = forEachStatement.
Type
.StripRefIfNeeded();
143
foreachStatement.
Type
== typeName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1656
@foreach.
Type
is IdentifierNameSyntax identifierName &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1263
var variableTypes = GetTypes(forEachStatementSyntax.
Type
);
Roslyn.Diagnostics.CSharp.Analyzers (9)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
657
ForEachStatementSyntax foreachStatement => foreachStatement.
Type
.IsTypeInferred(semanticModel),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
91
? forEachStatement.
Type
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
143
ForEachStatementSyntax forEach => forEach.
Type
,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
55
if (!forEachStatement.
Type
.StripRefIfNeeded().IsVar)
104
foreachStatement.
Type
== typeName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
61
var type = forEachStatement.
Type
.StripRefIfNeeded();
143
foreachStatement.
Type
== typeName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1656
@foreach.
Type
is IdentifierNameSyntax identifierName &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1263
var variableTypes = GetTypes(forEachStatementSyntax.
Type
);