414 references to GetConversion
Microsoft.CodeAnalysis.CSharp.CodeStyle (11)
src\Analyzers\CSharp\Analyzers\SimplifyBooleanExpression\CSharpSimplifyConditionalDiagnosticAnalyzer.cs (1)
26=> semanticModel.GetConversion(node, cancellationToken).ToCommonConversion();
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\UseCoalesceExpressionHelpers.cs (1)
14var conversion = semanticModel.GetConversion(conditional, cancellationToken);
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
108var initializerConversion = semanticModel.GetConversion(initializerValue, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
645var conversion = semanticModel.GetConversion(castedExpressionNode, cancellationToken); 1005var conversion = semanticModel.GetConversion(castedExpressionNode, cancellationToken); 1033var parentConversion = semanticModel.GetConversion(castNode, cancellationToken); 1081var conversion = semanticModel.GetConversion(current, cancellationToken); 1469var rewrittenConversion = rewrittenSemanticModel.GetConversion(rewrittenExpression, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
815var originalConversion = originalModel.GetConversion(originalExpression); 816var newConversion = newModel.GetConversion(newExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
328var conversion = semanticModel.GetConversion(expression, cancellationToken);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyTestBase.cs (1)
399var conv = model.GetConversion(expr);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (111)
CodeGen\CodeGenDeconstructTests.cs (5)
105Assert.Equal(ConversionKind.Identity, model.GetConversion(right).Kind); 1130var tupleConversion = model.GetConversion(tuple); 3451Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(literal).Kind); 3487Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(literal).Kind); 3493Assert.Equal(ConversionKind.Identity, model.GetConversion(nestedLiteral).Kind);
CodeGen\CodeGenFunctionPointersTests.cs (2)
10809var conversion = model.GetConversion(lambdas[0]); 10817conversion = model.GetConversion(lambdas[1]);
CodeGen\CodeGenTupleEqualityTests.cs (28)
364Assert.Equal(Conversion.Identity, model.GetConversion(tupleX)); 369Assert.Equal(Conversion.Identity, model.GetConversion(lastX)); 383Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(tupleY).Kind); 387Assert.Equal(Conversion.ImplicitNumeric, model.GetConversion(lastY)); 719Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(t).Kind); 729Assert.Equal(Conversion.Identity, model.GetConversion(tuple)); 803Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(tuple1Null).Kind); 816Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(tuple2Null).Kind); 863Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(t1).Kind); 872Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(tuple).Kind); 880Assert.Equal(ConversionKind.ImplicitNumeric, model.GetConversion(two).Kind); 911Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(t1).Kind); 920Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(tuple).Kind); 928Assert.Equal(ConversionKind.ImplicitConstant, model.GetConversion(two).Kind); 960Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(t1).Kind); 976Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(t2).Kind); 1014Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(lastTuple).Kind); 1021Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(nullNull).Kind); 1028Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(lastNull).Kind); 1512Assert.Equal(ConversionKind.Identity, model.GetConversion(t).Kind); 1523Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(nestedTuple).Kind); 1534Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(nestedNull).Kind); 5166Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(leftCast).Kind); 5174Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(leftTuple).Kind); 5182Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(leftNull).Kind); 5190Assert.Equal(ConversionKind.Identity, model.GetConversion(leftNestedTuple).Kind); 5197Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(rightCast).Kind); 5204Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(rightTuple).Kind);
CodeGen\CodeGenTupleTest.cs (76)
7500var castConversion = model.GetConversion(value); 7504var tupleConversion = model.GetConversion(tuple); 7533var tupleConversion = model.GetConversion(value); 7575var conversion1 = model.GetConversion(tuple1); 7584var conversion2 = model.GetConversion(tuple2); 7593var conversion3 = model.GetConversion(tuple3); 7641var conversion = model.GetConversion(tuple); 8297Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node).Kind); 8329Assert.Equal(Conversion.Identity, model.GetConversion(l11)); 8336Assert.Equal(ConversionKind.ExplicitNullable, model.GetConversion(node).Kind); 8343Assert.Equal(ConversionKind.ImplicitConstant, model.GetConversion(element).Kind); 8348Assert.Equal(ConversionKind.Identity, model.GetConversion(element).Kind); 8354Assert.Equal(Conversion.Identity, model.GetConversion(node.Parent)); 8384Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node).Kind); 8412Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node).Kind); 8441Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(node).Kind); 8448Assert.Equal(ConversionKind.ImplicitConstant, model.GetConversion(element).Kind); 8453Assert.Equal(ConversionKind.Identity, model.GetConversion(element).Kind); 8459Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node.Parent).Kind); 8489Assert.Equal(ConversionKind.ImplicitTuple, model.GetConversion(node).Kind); 8496Assert.Equal(Conversion.Identity, model.GetConversion(node)); 8523Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node).Kind); 8530Assert.Equal(Conversion.Identity, model.GetConversion(node)); 8556Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node).Kind); 8585Assert.Equal(ConversionKind.ExplicitNullable, model.GetConversion(node).Kind); 8592Assert.Equal(ConversionKind.Identity, model.GetConversion(element).Kind); 8597Assert.Equal(ConversionKind.Identity, model.GetConversion(element).Kind); 8603Assert.Equal(Conversion.Identity, model.GetConversion(node.Parent)); 8632Assert.Equal(Conversion.Identity, model.GetConversion(node)); 8638Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(node.Parent).Kind); 8667Assert.Equal(Conversion.Identity, model.GetConversion(node)); 8696Assert.Equal(Conversion.Identity, model.GetConversion(node)); 8725Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(node).Kind); 8756Assert.Equal(Conversion.Identity, model.GetConversion(l11)); 8763Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(node).Kind); 8770Assert.Equal(ConversionKind.ImplicitConstant, model.GetConversion(element).Kind); 8775Assert.Equal(ConversionKind.Identity, model.GetConversion(element).Kind); 8781Assert.Equal(Conversion.Identity, model.GetConversion(node.Parent)); 8810Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(node).Kind); 8841Assert.Equal(Conversion.Identity, model.GetConversion(lnull)); 8848Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(node).Kind); 8854Assert.Equal(Conversion.Identity, model.GetConversion(node.Parent)); 8899Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(node).Kind); 8946Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(node).Kind); 8953Assert.Equal(ConversionKind.ImplicitConstant, model.GetConversion(element).Kind); 8958Assert.Equal(ConversionKind.ExplicitUserDefined, model.GetConversion(element).Kind); 8964Assert.Equal(Conversion.Identity, model.GetConversion(node.Parent)); 9020Assert.Equal(ConversionKind.ImplicitUserDefined, model.GetConversion(node).Kind); 9077Assert.Equal(Conversion.NoConversion, model.GetConversion(node)); 9149Assert.Equal(ConversionKind.ImplicitUserDefined, model.GetConversion(node).Kind); 9230Assert.Equal(ConversionKind.ImplicitUserDefined, model.GetConversion(node).Kind); 9313Assert.Equal(ConversionKind.ImplicitUserDefined, model.GetConversion(node).Kind); 16546Assert.Equal(ConversionKind.Identity, model.GetConversion(node).Kind); 17217Assert.Equal(Conversion.Identity, model.GetConversion(n1)); 17224Assert.Equal(Conversion.Identity, model.GetConversion(n2)); 17231Assert.Equal(Conversion.Identity, model.GetConversion(n3)); 17238Assert.Equal(Conversion.Identity, model.GetConversion(n4)); 17245Assert.Equal(ConversionKind.AnonymousFunction, model.GetConversion(n5).Kind); 17278Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(n1).Kind); 17285Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(n2).Kind); 17292Assert.Equal(ConversionKind.ImplicitConstant, model.GetConversion(n3).Kind); 17299Assert.Equal(Conversion.ImplicitReference, model.GetConversion(n4)); 17306Assert.Equal(ConversionKind.AnonymousFunction, model.GetConversion(n5).Kind); 17337Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(n1).Kind); 17344Assert.Equal(ConversionKind.ImplicitTupleLiteral, model.GetConversion(n2).Kind); 25706Assert.Equal(ConversionKind.ExplicitTupleLiteral, model.GetConversion(tuple).Kind); 25711Assert.Equal(ConversionKind.ExplicitNullable, model.GetConversion(first).Kind); 25716Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(second).Kind); 25777Assert.Equal(ConversionKind.ExplicitNullable, model.GetConversion(tuple).Kind); 25782Assert.Equal(ConversionKind.ExplicitNullable, model.GetConversion(first).Kind); 25787Assert.Equal(ConversionKind.ImplicitReference, model.GetConversion(second).Kind); 25842Assert.Equal(ConversionKind.NoConversion, model.GetConversion(tuple).Kind); 25847Assert.Equal(ConversionKind.Identity, model.GetConversion(first).Kind); 25852Assert.Equal(ConversionKind.Identity, model.GetConversion(second).Kind); 25884Assert.Equal(ConversionKind.Identity, model.GetConversion(tuple).Kind); 25914Assert.Equal(ConversionKind.NoConversion, model.GetConversion(tuple).Kind);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\NumericIntPtrTests.cs (2)
10548Assert.Equal("nint nint.op_Implicit(System.String s)", model.GetConversion(returnStatements[0].Expression).Method.ToTestDisplayString()); 10549Assert.Equal("nuint nuint.op_Implicit(System.String s)", model.GetConversion(returnStatements[1].Expression).Method.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (78)
FirstClassSpanTests.cs (1)
2738var argConv = model.GetConversion(arg);
Semantics\CollectionExpressionTests.cs (51)
14301var conversion = model.GetConversion(returnValue); 14377var conversion = model.GetConversion(returnValue); 14450var conversion = model.GetConversion(collection); 14514var castConversion = model.GetConversion(cast); 14519var conversion = model.GetConversion(value); 14638var castConversion = model.GetConversion(cast); 14643var conversion = model.GetConversion(value); 14722var conversion = model.GetConversion(nestedCollection); 14811var conversion = model.GetConversion(nestedCollection); 15165var conversion = model.GetConversion(expr); 28695var conversion1 = model.GetConversion(collections[0]); 28699var conversion2 = model.GetConversion(collections[1]); 28739var conversion1 = model.GetConversion(collections[0]); 28743var conversion2 = model.GetConversion(collections[1]); 28788var conversion1 = model.GetConversion(collections[0]); 28793var conversion2 = model.GetConversion(collections[1]); 28829var conversion1 = model.GetConversion(collections[0]); 28833var conversion2 = model.GetConversion(collections[1]); 28872var conversion1 = model.GetConversion(collections[0]); 28876var conversion2 = model.GetConversion(collections[1]); 28915var conversion = model.GetConversion(collection); 28955var conversion = model.GetConversion(collection); 28987var conversion = model.GetConversion(collection); 29021var conversion1 = model.GetConversion(collections[0]); 29025var conversion2 = model.GetConversion(collections[1]); 29033var conversion3 = model.GetConversion(collections[2]); 29041var conversion4 = model.GetConversion(collections[3]); 29074var conversion1 = model.GetConversion(collections[0]); 29078var conversion2 = model.GetConversion(collections[1]); 29086var conversion3 = model.GetConversion(collections[2]); 29094var conversion4 = model.GetConversion(collections[3]); 29140var conversion1 = model.GetConversion(collections[0]); 29143var conversion2 = model.GetConversion(collections[1]); 29150var conversion3 = model.GetConversion(collections[2]); 29157var conversion4 = model.GetConversion(collections[3]); 29201var conversion1 = model.GetConversion(collections[0]); 29204var conversion2 = model.GetConversion(collections[1]); 29211var conversion3 = model.GetConversion(collections[2]); 29218var conversion4 = model.GetConversion(collections[3]); 29277var conversion1 = model.GetConversion(collection); 29320var conversion1 = model.GetConversion(collections[0]); 29325var conversion2 = model.GetConversion(collections[1]); 29367var conversion = model.GetConversion(collection); 32389var collectionConversion = model.GetConversion(collection); 32395var elementConversion = model.GetConversion(element); 32486var elementConversion1 = model.GetConversion(element1); 32492var elementConversion2 = model.GetConversion(element2); 32528var elementConversion1 = model.GetConversion(element1); 32534var elementConversion2 = model.GetConversion(element2); 32573var elementConversion1 = model.GetConversion(element1); 32579var elementConversion2 = model.GetConversion(element2);
Semantics\InlineArrayTests.cs (6)
15215Assert.Equal(ConversionKind.InlineArray, model.GetConversion(f[^2]).Kind); 15222Assert.Equal(ConversionKind.InlineArray, model.GetConversion(f[^1]).Kind); 16502Assert.Equal(ConversionKind.InlineArray, model.GetConversion(m3).Kind); 18591Assert.True(model.GetConversion(f).IsIdentity); 18917Assert.True(model.GetConversion(f).IsIdentity); 19254Assert.True(model.GetConversion(collection).IsIdentity);
Semantics\OutVarTests.cs (9)
1034Assert.True(model.GetConversion(decl).IsIdentity); 1056Assert.True(model.GetConversion(typeSyntax).IsIdentity); 33028Assert.True(model.GetConversion(declaration1.Type).IsIdentity); 33044Assert.True(model.GetConversion(declaration2.Type).IsIdentity); 33100Assert.True(model.GetConversion(declaration1.Type).IsIdentity); 33142Assert.True(model.GetConversion(declaration1.Type).IsIdentity); 33158Assert.True(model.GetConversion(declaration2.Type).IsIdentity); 33206Assert.True(model.GetConversion(declaration1.Type).IsIdentity); 33224Assert.True(model.GetConversion(declaration2.Type).IsIdentity);
Semantics\ParamsCollectionTests.cs (8)
178Assert.True(model.GetConversion(argument).IsNumeric); 234Assert.True(model.GetConversion(expression).IsIdentity); 350Assert.True(model.GetConversion(expression).IsIdentity); 533Assert.True(model.GetConversion(expression).IsIdentity); 678Assert.True(model.GetConversion(expression).IsIdentity); 1422Assert.True(model.GetConversion(expression).IsIdentity); 2546Assert.True(model.GetConversion(expression).IsIdentity); 2682Assert.True(model.GetConversion(expression).IsIdentity);
Semantics\PatternMatchingTestBase.cs (2)
137Assert.True(model.GetConversion(typeSyntax).IsIdentity); 396Assert.True(model.GetConversion(decl.Type).IsIdentity);
Semantics\PatternMatchingTests2.cs (1)
2875var conversion = model.GetConversion(expr);
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\Analyzers\SimplifyBooleanExpression\CSharpSimplifyConditionalDiagnosticAnalyzer.cs (1)
26=> semanticModel.GetConversion(node, cancellationToken).ToCommonConversion();
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\UseCoalesceExpressionHelpers.cs (1)
14var conversion = semanticModel.GetConversion(conditional, cancellationToken);
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
108var initializerConversion = semanticModel.GetConversion(initializerValue, cancellationToken);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IVariableDeclaration.cs (2)
932Assert.Equal(Conversion.Identity, model.GetConversion(literalExpr)); 939Assert.Equal(Conversion.Identity, model.GetConversion(invocExpr));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (166)
Semantics\DeconstructionTests.cs (83)
4263Assert.True(model.GetConversion(declarations[0]).IsIdentity); 4275Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 4287Assert.True(model.GetConversion(declarations[1]).IsIdentity); 4293Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 4304Assert.True(model.GetConversion(declarations[2]).IsIdentity); 4309Assert.True(model.GetConversion(declarations[2].Type).IsIdentity); 4318Assert.True(model.GetConversion(tuple).IsIdentity); 4398Assert.True(model.GetConversion(declarations[0]).IsIdentity); 4406Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 4418Assert.True(model.GetConversion(declarations[1]).IsIdentity); 4424Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 4435Assert.True(model.GetConversion(declarations[2]).IsIdentity); 4440Assert.True(model.GetConversion(declarations[2].Type).IsIdentity); 4449Assert.True(model.GetConversion(tuple).IsIdentity); 4522Assert.True(model.GetConversion(declarations[0]).IsIdentity); 4534Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 4546Assert.True(model.GetConversion(declarations[1]).IsIdentity); 4555Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 4566Assert.True(model.GetConversion(declarations[2]).IsIdentity); 4574Assert.True(model.GetConversion(declarations[2].Type).IsIdentity); 4583Assert.True(model.GetConversion(tuple).IsIdentity); 4672Assert.True(model.GetConversion(declarations[0]).IsIdentity); 4680Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 4691Assert.True(model.GetConversion(declarations[1]).IsIdentity); 4696Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 4766Assert.True(model.GetConversion(declarations[0]).IsIdentity); 4774Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 4785Assert.True(model.GetConversion(declarations[1]).IsIdentity); 4790Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 4844Assert.True(model.GetConversion(declarations[0]).IsIdentity); 4852Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 4863Assert.True(model.GetConversion(declarations[1]).IsIdentity); 4871Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 4948Assert.True(model.GetConversion(declaration).IsIdentity); 4953Assert.True(model.GetConversion(declaration.Type).IsIdentity); 4994Assert.True(model.GetConversion(declaration).IsIdentity); 4999Assert.True(model.GetConversion(declaration.Type).IsIdentity); 5052Assert.True(model.GetConversion(declaration).IsIdentity); 5060Assert.True(model.GetConversion(declaration.Type).IsIdentity); 5212Assert.True(model.GetConversion(declarations[0]).IsIdentity); 5220Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 5232Assert.True(model.GetConversion(declarations[1]).IsIdentity); 5238Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 5249Assert.True(model.GetConversion(declarations[2]).IsIdentity); 5254Assert.True(model.GetConversion(declarations[2].Type).IsIdentity); 5266Assert.True(model.GetConversion(tuples[0]).IsIdentity); 5276Assert.True(model.GetConversion(tuples[1]).IsIdentity); 5356Assert.True(model.GetConversion(declarations[0]).IsIdentity); 5364Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 5376Assert.True(model.GetConversion(declarations[1]).IsIdentity); 5382Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 5393Assert.True(model.GetConversion(declarations[2]).IsIdentity); 5398Assert.True(model.GetConversion(declarations[2].Type).IsIdentity); 5410Assert.True(model.GetConversion(tuples[0]).IsIdentity); 5420Assert.True(model.GetConversion(tuples[1]).IsIdentity); 5493Assert.True(model.GetConversion(declarations[0]).IsIdentity); 5501Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 5513Assert.True(model.GetConversion(declarations[1]).IsIdentity); 5522Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 5533Assert.True(model.GetConversion(declarations[2]).IsIdentity); 5541Assert.True(model.GetConversion(declarations[2].Type).IsIdentity); 5553Assert.True(model.GetConversion(tuples[0]).IsIdentity); 5563Assert.True(model.GetConversion(tuples[1]).IsIdentity); 5680Assert.True(model.GetConversion(declarations[0]).IsIdentity); 5688Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 5699Assert.True(model.GetConversion(declarations[1]).IsIdentity); 5704Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 5713Assert.True(model.GetConversion(tuple).IsIdentity); 5790Assert.True(model.GetConversion(declarations[0]).IsIdentity); 5798Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 5809Assert.True(model.GetConversion(declarations[1]).IsIdentity); 5814Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 5823Assert.True(model.GetConversion(tuple).IsIdentity); 5893Assert.True(model.GetConversion(declarations[0]).IsIdentity); 5901Assert.True(model.GetConversion(declarations[0].Type).IsIdentity); 5912Assert.True(model.GetConversion(declarations[1]).IsIdentity); 5920Assert.True(model.GetConversion(declarations[1].Type).IsIdentity); 5929Assert.True(model.GetConversion(tuple).IsIdentity); 5990Assert.Equal(ConversionKind.Identity, model.GetConversion(mainCall).Kind); 6033Assert.Equal(ConversionKind.Identity, model.GetConversion(mainCall).Kind); 6073Assert.Equal(ConversionKind.Identity, model.GetConversion(mainCall).Kind); 6115Assert.Equal(ConversionKind.Identity, model.GetConversion(two).Kind); 6155Assert.Equal(ConversionKind.Identity, model.GetConversion(mainCall).Kind);
Semantics\ForEachTests.cs (1)
2147var conv = model.GetConversion(loopSyntax.Type);
Semantics\FunctionPointerTests.cs (5)
213var conversion = model.GetConversion(initializer1); 295var conversion = model.GetConversion(literal); 605var conversion = model.GetConversion(decl); 844var conversion = model.GetConversion(decl); 902var conversion = model.GetConversion(initializer);
Semantics\ImplicitObjectCreationTests.cs (14)
68Assert.Equal(conversionKind, model.GetConversion(@new).Kind); 143Assert.Equal(conversionKind, model.GetConversion(@new).Kind); 190Assert.Equal(conversionKind, model.GetConversion(@new).Kind); 242Assert.Equal(conversionKind, model.GetConversion(@new).Kind); 848Assert.Equal(ConversionKind.ObjectCreation, model.GetConversion(@new).Kind); 889Assert.Equal(ConversionKind.ObjectCreation, model.GetConversion(@new).Kind); 1718Assert.Equal(conversionKind, model.GetConversion(invocation).Kind); 1873Assert.True(model.GetConversion(def).IsObjectCreation); 1903Assert.True(model.GetConversion(def).IsObjectCreation); 1933Assert.True(model.GetConversion(def).IsObjectCreation); 1934Assert.True(model.GetConversion(def).IsImplicit); 2137Assert.Equal(conversionKind, model.GetConversion(@new).Kind); 2225Assert.True(model.GetConversion(def).IsObjectCreation); 2935Assert.Equal(conversionKind, model.GetConversion(@new).Kind);
Semantics\IteratorTests.cs (2)
620Assert.True(model.GetConversion(node).IsIdentity); 658Assert.True(model.GetConversion(node).IsIdentity);
Semantics\LambdaTests.cs (3)
845var conv = model.GetConversion(expr); 852conv = model.GetConversion(expr); 862conv = model.GetConversion(expr);
Semantics\ObjectAndCollectionInitializerTests.cs (3)
3812var conversion = model.GetConversion(literal); 3835var conversion = model.GetConversion(literal); 3859var conversion = model.GetConversion(literal);
Semantics\TargetTypedDefaultTests.cs (33)
49Assert.False(model.GetConversion(def).IsNullLiteral); 50Assert.True(model.GetConversion(def).IsDefaultLiteral); 149Assert.False(model.GetConversion(def).IsNullLiteral); 150Assert.True(model.GetConversion(def).IsDefaultLiteral); 250Assert.False(model.GetConversion(def).IsNullLiteral); 251Assert.True(model.GetConversion(def).IsDefaultLiteral); 287Assert.False(model.GetConversion(def).IsNullLiteral); 288Assert.True(model.GetConversion(def).IsDefaultLiteral); 330Assert.True(model.GetConversion(default1).IsDefaultLiteral); 336Assert.Equal(Conversion.Identity, model.GetConversion(default2)); 526Assert.False(model.GetConversion(def).IsNullLiteral); 527Assert.False(model.GetConversion(def).IsDefaultLiteral); 572Assert.False(model.GetConversion(def).IsNullLiteral); 573Assert.False(model.GetConversion(def).IsDefaultLiteral); 615Assert.False(model.GetConversion(def).IsNullLiteral); 616Assert.False(model.GetConversion(def).IsDefaultLiteral); 673Assert.False(model.GetConversion(def).IsNullLiteral); 674Assert.True(model.GetConversion(def).IsDefaultLiteral); 754Assert.False(model.GetConversion(def).IsNullLiteral); 755Assert.False(model.GetConversion(def).IsDefaultLiteral); 842Assert.False(model.GetConversion(def).IsNullLiteral); 843Assert.True(model.GetConversion(def).IsDefaultLiteral); 871Assert.False(model.GetConversion(def).IsNullLiteral); 872Assert.True(model.GetConversion(def).IsDefaultLiteral); 3060Assert.False(model.GetConversion(def).IsNullLiteral); 3061Assert.True(model.GetConversion(def).IsDefaultLiteral); 3522Assert.True(model.GetConversion(def).IsIdentity); 3529Conversion conversion = model.GetConversion(conversionSyntax); 3580Assert.False(model.GetConversion(default1).IsNullLiteral); 3581Assert.True(model.GetConversion(default1).IsDefaultLiteral); 3588Assert.Equal(ConversionKind.Identity, model.GetConversion(default2).Kind); 3595Assert.Equal(ConversionKind.ImplicitNullable, model.GetConversion(default3).Kind); 3602Conversion conversion = model.GetConversion(default4);
Semantics\TopLevelStatementsTests.cs (2)
9708var conversionInTopLevel = speculativeModelInTopLevel.GetConversion(nodeToSpeculate.DescendantTokens().Single(n => n.ValueText == "x").Parent); 9713var conversionOutsideTopLevel = speculativeModelOutsideTopLevel.GetConversion(nodeToSpeculate.DescendantTokens().Single(n => n.ValueText == "x").Parent);
Semantics\UnsafeTests.cs (7)
7267var conv = model.GetConversion(syntax); 7334var conv = model.GetConversion(syntax); 7372var conv = model.GetConversion(syntax); 7414var conv = model.GetConversion(syntax); 7545var conv = model.GetConversion(syntax); 8349var conv = model.GetConversion(node); 8394var conv = model.GetConversion(value);
Semantics\Utf8StringsLiteralsTests.cs (13)
2979Assert.False(model.GetConversion(node).Exists); 3007Assert.True(model.GetConversion(node).IsIdentity); 3035Assert.False(model.GetConversion(node).Exists); 3063Assert.True(model.GetConversion(node).IsIdentity); 3091Assert.False(model.GetConversion(node).Exists); 3119Assert.True(model.GetConversion(node).IsIdentity); 3147Assert.False(model.GetConversion(node).Exists); 3175Assert.True(model.GetConversion(node).IsIdentity); 3203Assert.False(model.GetConversion(node).Exists); 3231Assert.True(model.GetConversion(node).IsIdentity); 3259Assert.True(model.GetConversion(node).IsIdentity); 3287Assert.True(model.GetConversion(node).IsSpan); 3315Assert.True(model.GetConversion(node).IsIdentity);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (28)
Compilation\GetSemanticInfoTests.cs (21)
108var conv = model.GetConversion(expr); 142var conv = model.GetConversion(expr); 604var impconv = model.GetConversion(expr1); 634var impconv = model.GetConversion(expr1); 847var conv = semanticModel.GetConversion(expr); 2456var conv = model.GetConversion(expr); 2485var conv = model.GetConversion(expr); 2734var conv = model.GetConversion(expr); 2805var conv = model.GetConversion(expr); 3277ThreadStart ts = () => sawWrongConversionKind |= ConversionKind.Identity != model.GetConversion(expr).Kind; 3477var argConversion = model.GetConversion(argexpr); 3531var argConversion = model.GetConversion(argexpr); 3610var conv = model.GetConversion(literal); 3635var literalConversion = model.GetConversion(literal); 3643var castConversion = model.GetConversion(cast); 3668var literalConversion = model.GetConversion(literal); 3676var castConversion = model.GetConversion(cast); 3704var literalConversion = model.GetConversion(literal); 3712var cast1Conversion = model.GetConversion(cast1); 3724var cast2Conversion = model.GetConversion(cast2); 4379var conv = model.GetConversion(syntax);
Compilation\SemanticModelAPITests.cs (1)
2281var conv = speculativeModel.GetConversion(initializer);
Compilation\SemanticModelGetSemanticInfoTests.cs (6)
14809var conv = model.GetConversion(creation.Type); 14825conv = model.GetConversion(creation); 14905var conv = model.GetConversion(creation.Type); 14921conv = model.GetConversion(creation); 15016var conv = model.GetConversion(creation.Type); 15031conv = model.GetConversion(creation);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CompilationTestUtils.cs (4)
242summary.ImplicitConversion = semanticModel.GetConversion(expr); 251summary.ImplicitConversion = semanticModel.GetConversion(attribute); 268summary.ImplicitConversion = semanticModel.GetConversion(initializer); 279summary.ImplicitConversion = semanticModel.GetConversion(pattern);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
645var conversion = semanticModel.GetConversion(castedExpressionNode, cancellationToken); 1005var conversion = semanticModel.GetConversion(castedExpressionNode, cancellationToken); 1033var parentConversion = semanticModel.GetConversion(castNode, cancellationToken); 1081var conversion = semanticModel.GetConversion(current, cancellationToken); 1469var rewrittenConversion = rewrittenSemanticModel.GetConversion(rewrittenExpression, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
815var originalConversion = originalModel.GetConversion(originalExpression); 816var newConversion = newModel.GetConversion(newExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
328var conversion = semanticModel.GetConversion(expression, cancellationToken);