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