1 write to ElementType
Microsoft.CodeAnalysis.CSharp (1)
Compilation\ForEachStatementInfo.cs (1)
79this.ElementType = elementType;
94 references to ElementType
Microsoft.CodeAnalysis.CSharp (5)
Compilation\ForEachStatementInfo.cs (5)
50/// The conversion from the <see cref="ElementType"/> to the iteration variable type. 58/// The conversion from the type of the <see cref="CurrentProperty"/> to the <see cref="ElementType"/>. 96&& object.Equals(this.ElementType, other.ElementType) 108Hash.Combine(ElementType,
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\ForEachCast\CSharpForEachCastDiagnosticAnalyzer.cs (1)
30return (info.ElementConversion.ToCommonConversion(), info.ElementType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
179info.ElementType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
894elementType = info.ElementType;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\ForEachCast\CSharpForEachCastCodeFixProvider.cs (1)
24var result = forEachInfo.ElementType;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
73type = model.GetForEachStatementInfo(@foreach).ElementType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (2)
63if (foreachInfo.ElementType is null) 70if (foreachInfo.ElementType.NullableAnnotation != NullableAnnotation.NotAnnotated)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (18)
CodeGen\CodeGenAwaitForeachTests.cs (18)
944Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 1668Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 2973Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 3038Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 3123Assert.Null(info.ElementType); 3240Assert.Null(info.ElementType); 3725Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 4472Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 4546Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 4656Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 4755Assert.Equal("(System.String, System.Int32)", info.ElementType.ToTestDisplayString()); 5059Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 5140Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 6446Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9119Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9195Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9273Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9405Assert.Equal("(System.Int32, System.Int32)", info.ElementType.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (47)
RefStructInterfacesTests.cs (43)
7580AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 7770AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 7990AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 8180AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 8373AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 8448Assert.Null(info.ElementType); 8652AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9022AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9226AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9390Assert.Null(info.ElementType); 9590AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 9814AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 10023AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 10250AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 10353Assert.Null(info.ElementType); 10448Assert.Null(info.ElementType); 10633AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 10830AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 11071AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 11298AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 11510AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 11610AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 11705AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 14263AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 14604AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 14971AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 15314AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 15662AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 15739Assert.Null(info.ElementType); 16100AssertEx.Equal("System.Int32", info.ElementType.ToTestDisplayString()); 17767AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 17964AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 18188AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 18384AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 18585AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 18659Assert.Null(info.ElementType); 18869AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 19203AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 19374AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 19531Assert.Null(info.ElementType); 19699AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 19867AssertEx.Equal("System.Object", info.ElementType.ToTestDisplayString()); 19972Assert.Null(info.ElementType);
Semantics\InlineArrayTests.cs (3)
18600Assert.Equal("System.Int32", forEachInfo.ElementType.ToTestDisplayString()); 18926Assert.Equal("System.Int32", forEachInfo.ElementType.ToTestDisplayString()); 19263Assert.Equal("System.Int32", forEachInfo.ElementType.ToTestDisplayString());
Semantics\OutVarTests.cs (1)
35651Assert.Equal("System.Object", info.ElementType.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Features (4)
InlineHints\CSharpInlineTypeHintsService.cs (1)
70var type = info.ElementType;
src\Analyzers\CSharp\Analyzers\ForEachCast\CSharpForEachCastDiagnosticAnalyzer.cs (1)
30return (info.ElementConversion.ToCommonConversion(), info.ElementType);
src\Analyzers\CSharp\CodeFixes\ForEachCast\CSharpForEachCastCodeFixProvider.cs (1)
24var result = forEachInfo.ElementType;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
73type = model.GetForEachStatementInfo(@foreach).ElementType;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\ForEachTests.cs (4)
2189Assert.Equal(SpecialType.System_String, loopInfo0.ElementType.SpecialType); 2198Assert.Equal(SpecialType.System_Object, loopInfo1.ElementType.SpecialType); // No longer string. 3301Assert.Equal(enumeratorInfo.ElementType.GetPublicSymbol(), statementInfo.ElementType); 3364Assert.Equal("System.Int32*", info.ElementType.ToTestDisplayString());
Semantics\NullableReferenceTypesTests.cs (4)
146306Assert.Equal("C<System.Object>", model.GetForEachStatementInfo(@foreach).ElementType.ToTestDisplayString()); 146346Assert.Equal("C<System.Object>", model.GetForEachStatementInfo(@foreach).ElementType.ToTestDisplayString()); 146385Assert.Equal("C<(System.Int32 a, System.Int32 b)>", model.GetForEachStatementInfo(@foreach).ElementType.ToTestDisplayString()); 146424Assert.Equal("C<(System.Int32 c, System.Int32 d)>", model.GetForEachStatementInfo(@foreach).ElementType.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
2603Assert.Equal(expectedElementTypeAnnotation, foreachInfo.ElementType.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
179info.ElementType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
894elementType = info.ElementType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (2)
63if (foreachInfo.ElementType is null) 70if (foreachInfo.ElementType.NullableAnnotation != NullableAnnotation.NotAnnotated)