1 write to ElementConversion
Microsoft.CodeAnalysis.CSharp (1)
Compilation\ForEachStatementInfo.cs (1)
80this.ElementConversion = elementConversion;
36 references to ElementConversion
Microsoft.CodeAnalysis.CSharp (3)
Compilation\ForEachStatementInfo.cs (3)
97&& this.ElementConversion == other.ElementConversion 109Hash.Combine(ElementConversion.GetHashCode(),
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\Analyzers\CSharp\Analyzers\ForEachCast\CSharpForEachCastDiagnosticAnalyzer.cs (1)
30return (info.ElementConversion.ToCommonConversion(), info.ElementType);
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
127var elementConversion = semanticModel.GetForEachStatementInfo(forEachStatement).ElementConversion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1230var oldConversion = oldForEachInfo.ElementConversion; 1231var newConversion = newForEachInfo.ElementConversion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
882&& ConversionsAreCompatible(originalInfo.ElementConversion, newInfo.ElementConversion);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
150if (foreachStatementInfo.ElementConversion.IsIdentity)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenAwaitForeachTests.cs (11)
945Assert.Equal(ConversionKind.NoConversion, info.ElementConversion.Kind); 1669Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 3726Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 4473Assert.Equal(ConversionKind.ExplicitUserDefined, info.ElementConversion.Kind); 4474Assert.Equal("Element Element.op_Implicit(System.Int32 value)", info.ElementConversion.MethodSymbol.ToTestDisplayString()); 4547Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 4657Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 4756Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 5060Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 5141Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind); 6447Assert.Equal(ConversionKind.Identity, info.ElementConversion.Kind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Semantics\InlineArrayTests.cs (3)
18601Assert.True(forEachInfo.ElementConversion.IsIdentity); 18927Assert.True(forEachInfo.ElementConversion.IsIdentity); 19264Assert.True(forEachInfo.ElementConversion.IsIdentity);
Microsoft.CodeAnalysis.CSharp.Features (3)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
82var donotCastElement = foreachStatementInfo.ElementConversion.IsIdentity;
src\Analyzers\CSharp\Analyzers\ForEachCast\CSharpForEachCastDiagnosticAnalyzer.cs (1)
30return (info.ElementConversion.ToCommonConversion(), info.ElementType);
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
127var elementConversion = semanticModel.GetForEachStatementInfo(forEachStatement).ElementConversion;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\ForEachTests.cs (4)
2190Assert.Equal(udc, loopInfo0.ElementConversion.Method); 2199Assert.Null(loopInfo1.ElementConversion.Method); // No longer using UDC. 3302Assert.Equal(BoundNode.GetConversion(boundNode.ElementConversion, boundNode.ElementPlaceholder), statementInfo.ElementConversion); 3363Assert.Equal(Conversion.Identity, info.ElementConversion);
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1230var oldConversion = oldForEachInfo.ElementConversion; 1231var newConversion = newForEachInfo.ElementConversion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
882&& ConversionsAreCompatible(originalInfo.ElementConversion, newInfo.ElementConversion);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
150if (foreachStatementInfo.ElementConversion.IsIdentity)