1 write to ConvertedType
Microsoft.CodeAnalysis (1)
Compilation\TypeInfo.cs (1)
47
this.
ConvertedType
= convertedType;
1197 references to ConvertedType
Microsoft.CodeAnalysis (3)
Compilation\TypeInfo.cs (3)
54
&& object.Equals(this.
ConvertedType
, other.
ConvertedType
)
66
return Hash.Combine(this.
ConvertedType
,
Microsoft.CodeAnalysis.CodeStyle (15)
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
156
typeInfo.
ConvertedType
?.SpecialType == SpecialType.System_Boolean;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (1)
169
if (typeInfo.Type is IDynamicTypeSymbol || typeInfo.
ConvertedType
is IDynamicTypeSymbol)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
252
var convertedType = this.SemanticModel.GetTypeInfo(SyntaxFacts.GetExpressionOfArgument(arguments[0]), cancellationToken).
ConvertedType
;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
204
return semanticModel.GetTypeInfo(expression).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (5)
36
if (innerTypeInfo.Type != null && innerTypeInfo.
ConvertedType
!= null)
38
if (!innerTypeInfo.Type.Equals(innerTypeInfo.
ConvertedType
))
57
if (!Equals(semanticModel.GetTypeInfo(parentBinaryLeft).
ConvertedType
,
58
semanticModel.GetTypeInfo(parentBinaryRight).
ConvertedType
))
116
=> IsFloatingPoint(typeInfo.Type) || IsFloatingPoint(typeInfo.
ConvertedType
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (6)
291
return SymbolsAreCompatible(originalTypeInfo.
ConvertedType
, newTypeInfo.
ConvertedType
);
826
var expressionType = this.SpeculativeSemanticModel.GetTypeInfo(newForEachStatementExpression, CancellationToken).
ConvertedType
;
1001
? speculativeSemanticModel.GetTypeInfo(newReceiver).
ConvertedType
1216
var originalConvertedTypeSymbol = this.OriginalSemanticModel.GetTypeInfo(originalExpression).
ConvertedType
;
1222
var newConvertedTypeSymbol = this.SpeculativeSemanticModel.GetTypeInfo(newExpression).
ConvertedType
;
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
482
if (argumentTypeInfo.Type == null && argumentTypeInfo.
ConvertedType
== null)
538
if (parameterType.Equals(argumentTypeInfo.Type) || parameterType.Equals(argumentTypeInfo.
ConvertedType
))
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpCompilation.cs (1)
800
return info.
ConvertedType
?.SpecialType != SpecialType.System_Void;
Microsoft.CodeAnalysis.CSharp.CodeStyle (29)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (4)
127
if (lambdaTypeInfo.
ConvertedType
== null || lambdaTypeInfo.
ConvertedType
.SpecialType is SpecialType.System_Object)
217
var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).
ConvertedType
;
218
if (!lambdaTypeInfo.
ConvertedType
.Equals(rewrittenConvertedType))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
97
var convertedType = semanticModel.GetTypeInfo(expression.WalkUpParentheses(), cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (8)
96
if (originalTypeInfo.
ConvertedType
is null or IErrorTypeSymbol)
99
if (!IsConstructibleCollectionType(compilation, originalTypeInfo.
ConvertedType
.OriginalDefinition))
111
!originalTypeInfo.Type.Equals(originalTypeInfo.
ConvertedType
) &&
161
if (!originalTypeInfo.
ConvertedType
.Equals(replacedTypeInfo.
ConvertedType
) &&
162
!s_arrayAndReadOnlySpanCompareEquallyComparer.Equals(originalTypeInfo.
ConvertedType
, replacedTypeInfo.
ConvertedType
))
173
var convertedType = originalTypeInfo.
ConvertedType
;
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
42
if (semanticModel.GetTypeInfo(declaration, cancellationToken).
ConvertedType
is not INamedTypeSymbol lambdaType || lambdaType.DelegateInvokeMethod == null)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
114
var delegateType = semanticModel.GetTypeInfo(anonymousFunction, cancellationToken).
ConvertedType
as INamedTypeSymbol;
297
var convertedType = semanticModel.GetTypeInfo(nodeToCheck, cancellationToken).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
387
if (expressionTypes.
ConvertedType
.IsSpan() &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
797
if (expressionType.Equals(typeInfo.
ConvertedType
?.OriginalDefinition))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
307
var originalConvertedType = originalSemanticModel.GetTypeInfo(castNode.WalkUpParentheses(), cancellationToken).
ConvertedType
;
837
if (!originalConditionalTypeInfo.
ConvertedType
!.Equals(rewrittenConditionalTypeInfo.
ConvertedType
, SymbolEqualityComparer.IncludeNullability))
861
=> IsNullOrErrorType(info.Type) || IsNullOrErrorType(info.
ConvertedType
);
1468
var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (6)
399
newExpressionType = newExpressionTypeInfo.
ConvertedType
;
547
var originalConvertedTypeConversion = this.OriginalSemanticModel.ClassifyConversion(previousOriginalNode, originalExpressionTypeInfo.
ConvertedType
);
548
var newExpressionConvertedTypeConversion = this.SpeculativeSemanticModel.ClassifyConversion(previousReplacedNode, newExpressionTypeInfo.
ConvertedType
);
758
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.
ConvertedType
))
785
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.
ConvertedType
))
804
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.
ConvertedType
))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (5)
193
if (typeInfo.
ConvertedType
is not null &&
195
!Equals(typeInfo.
ConvertedType
, typeInfo.Type))
197
var conversion = _semanticModel.Compilation.ClassifyConversion(typeInfo.Type, typeInfo.
ConvertedType
);
199
return node.Cast(typeInfo.
ConvertedType
);
263
var expressionConvertedType = _semanticModel.GetTypeInfo(node.Expression).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
174
typeToGenerateIn = document.SemanticModel.GetTypeInfo(expression, cancellationToken).
ConvertedType
as INamedTypeSymbol;
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
84
var type = semanticModel.GetTypeInfo(defaultLiteral, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
46
var type = semanticModel.GetTypeInfo(variableDeclaration.Type, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
81
var lambdaType = (INamedTypeSymbol)semanticModel.GetTypeInfo(declaration).
ConvertedType
!;
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
220
var typeSymbol = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
101
var delegateType = (INamedTypeSymbol)semanticModel.GetTypeInfo(anonymousFunction, cancellationToken).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1432
var type = this.SemanticModel.GetTypeInfo(recursivePattern).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (1)
10
=> typeInfo.
ConvertedType
?.WithNullableAnnotation(typeInfo.ConvertedNullability.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (1)
92
Assert.Equal(SpecialType.System_String, typeInfo.
ConvertedType
.SpecialType);
SymbolKey\SymbolKeyTestBase.cs (1)
57
ResolveAndVerifySymbol(typeinfo.Type ?? typeinfo.
ConvertedType
, sourceSymbol, sourceComp);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (173)
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (4)
898
Assert.Equal("System.Func<MyTask>", firstLambda.
ConvertedType
.ToTestDisplayString());
902
Assert.Equal("System.Func<MyTask>", secondLambda.
ConvertedType
.ToTestDisplayString());
950
Assert.Equal("System.Func<MyTask>", firstLambda.
ConvertedType
.ToTestDisplayString());
954
Assert.Equal("System.Func<MyTask<System.Int32>>", secondLambda.
ConvertedType
.ToTestDisplayString());
CodeGen\CodeGenDeconstructTests.cs (12)
99
Assert.Equal("(System.Int64 x, System.String y)", model.GetTypeInfo(lhs).
ConvertedType
.ToTestDisplayString());
104
Assert.Equal("C", model.GetTypeInfo(right).
ConvertedType
.ToTestDisplayString());
1477
Assert.Equal("(System.Int32 a, System.Int32 b)[missing]", model.GetTypeInfo(ab).
ConvertedType
.ToTestDisplayString());
2691
Assert.Equal("(System.Int64 x, (System.String y, System.String z))", model.GetTypeInfo(lhs).
ConvertedType
.ToTestDisplayString());
3283
Assert.Equal("(System.Int32 x1, (System.Int32 x2, System.String x3))", model.GetTypeInfo(lhs).
ConvertedType
.ToTestDisplayString());
3289
Assert.Equal("(System.Int32 x2, System.String x3)", model.GetTypeInfo(lhsNested).
ConvertedType
.ToTestDisplayString());
3333
Assert.Equal("(System.Int32 x1, System.Byte, (System.Int32 x2, System.String x3))", model.GetTypeInfo(lhs).
ConvertedType
.ToTestDisplayString());
3450
Assert.Equal("(System.String, System.Byte, System.Int32)", model.GetTypeInfo(literal).
ConvertedType
.ToTestDisplayString());
3486
Assert.Equal("(System.String, (System.Int32, System.Int32))", model.GetTypeInfo(literal).
ConvertedType
.ToTestDisplayString());
3492
Assert.Equal("(System.Int32, System.Int32)", model.GetTypeInfo(nestedLiteral).
ConvertedType
.ToTestDisplayString());
7241
Assert.Equal("(System.Int32 x1, System.Int32 z)", model.GetTypeInfo(lhs).
ConvertedType
.ToTestDisplayString());
7523
Assert.Equal("(System.Int32 x, (System.String y, System.Boolean z))", model.GetTypeInfo(lhs).
ConvertedType
.ToTestDisplayString());
CodeGen\CodeGenFunctionPointersTests.cs (2)
10813
typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: false));
10820
typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: false));
CodeGen\CodeGenLocalFunctionTests.cs (1)
167
Assert.Equal("System.Object", info.
ConvertedType
.ToTestDisplayString());
CodeGen\CodeGenTupleEqualityTests.cs (80)
374
Assert.Equal("System.Int32", xSymbol.
ConvertedType
.ToTestDisplayString());
378
Assert.Equal("(System.Int32, System.Int32)", tupleXSymbol.
ConvertedType
.ToTestDisplayString());
391
Assert.Equal("System.Int32", ySymbol.
ConvertedType
.ToTestDisplayString());
395
Assert.Equal("(System.Int32, System.Int32)", tupleYSymbol.
ConvertedType
.ToTestDisplayString());
685
Assert.Equal("(System.String, System.Int64)", symbol1.
ConvertedType
.ToTestDisplayString());
691
Assert.Equal("(System.String, System.Int64)", symbol2.
ConvertedType
.ToTestDisplayString());
723
Assert.Equal("(System.Int64, System.Int32)", tTypeInfo.
ConvertedType
.ToTestDisplayString());
733
Assert.Equal("(System.Int64, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
797
Assert.Equal("(System.String s, System.String)", tupleType1.
ConvertedType
.ToTestDisplayString());
802
Assert.Equal("System.String", tuple1NullTypeInfo.
ConvertedType
.ToTestDisplayString());
810
Assert.Equal("(System.String, System.String s)", tupleType2.
ConvertedType
.ToTestDisplayString());
815
Assert.Equal("System.String", tuple2NullTypeInfo.
ConvertedType
.ToTestDisplayString());
862
Assert.Equal("(System.Int64, System.Int64)", t1TypeInfo.
ConvertedType
.ToTestDisplayString());
871
Assert.Equal("(System.Int64, System.Int64)", tupleType.
ConvertedType
.ToTestDisplayString());
879
Assert.Equal("System.Int64", twoType.
ConvertedType
.ToTestDisplayString());
910
Assert.Equal("(System.Int64, System.UInt64)", t1TypeInfo.
ConvertedType
.ToTestDisplayString());
919
Assert.Equal("(System.Int64, System.UInt64)", tupleType.
ConvertedType
.ToTestDisplayString());
927
Assert.Equal("System.UInt64", twoType.
ConvertedType
.ToTestDisplayString());
959
Assert.Equal("(System.Int64, (System.Int64, System.String))", t1TypeInfo.
ConvertedType
.ToTestDisplayString());
968
Assert.Equal("(System.Int64, (System.Int64, System.String) t2)", tupleType.
ConvertedType
.ToTestDisplayString());
975
Assert.Equal("(System.Int64, System.String)", t2TypeInfo.
ConvertedType
.ToTestDisplayString());
1005
Assert.Equal("(System.String, System.String)", tupleType.
ConvertedType
.ToTestDisplayString());
1013
Assert.Equal("(System.Int32, (System.String, System.String))", lastTupleTypeInfo.
ConvertedType
.ToTestDisplayString());
1020
Assert.Equal("(System.String, System.String)", nullNullTypeInfo.
ConvertedType
.ToTestDisplayString());
1027
Assert.Equal("System.String", lastNullTypeInfo.
ConvertedType
.ToTestDisplayString());
1063
Assert.Equal("(System.String, System.String)", info.
ConvertedType
.ToTestDisplayString());
1097
Assert.Equal("(System.String, System.String)?", info.
ConvertedType
.ToTestDisplayString());
1129
Assert.Equal("(System.String, System.String)?", info.
ConvertedType
.ToTestDisplayString());
1160
Assert.Equal("System.Int32", info.
ConvertedType
.ToTestDisplayString());
1218
Assert.Equal("S?", type.
ConvertedType
.ToTestDisplayString());
1315
Assert.Equal("(System.String, System.String)?", model.GetTypeInfo(lastTuple).
ConvertedType
.ToTestDisplayString());
1320
Assert.Equal("System.String", model.GetTypeInfo(lastDefault).
ConvertedType
.ToTestDisplayString());
1401
Assert.Null(model.GetTypeInfo(nullLiteral).
ConvertedType
);
1406
Assert.Equal("System.String", model.GetTypeInfo(nullLiteral2).
ConvertedType
.ToTestDisplayString());
1415
Assert.Null(model.GetTypeInfo(defaultLiteral).
ConvertedType
);
1471
Assert.Null(model.GetTypeInfo(defaultLiteral).
ConvertedType
);
1503
tupleType.
ConvertedType
.ToTestDisplayString());
1511
Assert.Equal("(System.String, System.String)", tType.
ConvertedType
.ToTestDisplayString());
1522
Assert.Equal("(System.String, System.String)", nestedTupleType.
ConvertedType
.ToTestDisplayString());
1533
Assert.Equal("System.String", nestedNullType.
ConvertedType
.ToTestDisplayString());
1563
Assert.Null(symbol.
ConvertedType
);
1572
Assert.Null(symbol.
ConvertedType
);
1598
Assert.Equal("System.Int64", literalInfo.
ConvertedType
.ToTestDisplayString());
1623
Assert.Null(literalInfo.
ConvertedType
);
1629
Assert.Null(nestedLiteralInfo.
ConvertedType
);
1635
Assert.Equal("System.Int64", twoInfo.
ConvertedType
.ToTestDisplayString());
1680
Assert.Null(tupleType1.
ConvertedType
);
1688
Assert.Null(tupleType2.
ConvertedType
);
1693
verifyType("System.Delegate", model.GetTypeInfo(firstLambda).
ConvertedType
, inferDelegate: false); // cannot infer delegate type for x => x
1698
verifyType("System.Delegate", model.GetTypeInfo(methodGroup).
ConvertedType
, inferDelegate);
1705
verifyType("System.Delegate", model.GetTypeInfo(secondLambda).
ConvertedType
, inferDelegate);
1780
Assert.Equal("(System.String, System.String)", tupleType1.
ConvertedType
.ToTestDisplayString());
1786
Assert.Null(tupleType2.
ConvertedType
);
1922
Assert.Equal("(dynamic d1, dynamic)", tupleType1.
ConvertedType
.ToTestDisplayString());
1928
Assert.Equal("(dynamic, dynamic d2)", tupleType2.
ConvertedType
.ToTestDisplayString());
2579
Assert.Equal("(System.Int32, System.Int32)", intTupleType.
ConvertedType
.ToTestDisplayString());
2587
Assert.Equal("(System.Int32, System.Int32)", lastTupleType.
ConvertedType
.ToTestDisplayString());
2647
Assert.Equal("(System.Int64, System.Int64)?", t1Type.
ConvertedType
.ToTestDisplayString());
3283
Assert.Equal("(System.Int32, System.Int32)?", nt1Type.
ConvertedType
.ToTestDisplayString());
3289
Assert.Equal("(System.Int32, System.Int32)?", nt2Type.
ConvertedType
.ToTestDisplayString());
3689
Assert.Equal("(System.Int32, System.Int32)?", nt1Type.
ConvertedType
.ToTestDisplayString());
3695
Assert.Equal("(System.Int32, System.Int32)?", nt2Type.
ConvertedType
.ToTestDisplayString());
3813
Assert.Equal("(System.Int32, System.Int64)?", nt1Type.
ConvertedType
.ToTestDisplayString());
3819
Assert.Equal("(System.Int32, System.Int64)?", nt2Type.
ConvertedType
.ToTestDisplayString());
3916
Assert.Equal("(System.Int32, System.Int32)?", nt1Type.
ConvertedType
.ToTestDisplayString());
3922
Assert.Equal("(System.Int32, System.Int32)?", nt2Type.
ConvertedType
.ToTestDisplayString());
4041
Assert.Equal("(System.Int32, System.Int32)?", tupleType.
ConvertedType
.ToTestDisplayString());
4047
Assert.Equal("(System.Int32, System.Int32)?", ntType.
ConvertedType
.ToTestDisplayString());
4089
Assert.Equal("(System.Int32, System.Int32)?", tupleType.
ConvertedType
.ToTestDisplayString());
4095
Assert.Equal("(System.Int32, System.Int32)?", ntType.
ConvertedType
.ToTestDisplayString());
4188
Assert.Null(nullType.
ConvertedType
); // In nullable-null comparison, the null literal remains typeless
4281
Assert.Equal("System.ValueTuple<System.Int32?>", left.
ConvertedType
.ToTestDisplayString());
5128
Assert.Equal("(System.Int32 Alice, (System.Int32 Bob, System.Int32))", leftInfo.
ConvertedType
.ToTestDisplayString());
5134
Assert.Equal("(System.Int32 Bob, (System.Int32, System.Int32 Other))", rightInfo.
ConvertedType
.ToTestDisplayString());
5165
Assert.Equal("(System.String, (System.Int64, System.Int64))", leftCastInfo.
ConvertedType
.ToTestDisplayString());
5173
Assert.Equal("(System.String, (System.Byte, System.Int64))", leftTupleInfo.
ConvertedType
.ToTestDisplayString());
5181
Assert.Equal("System.String", leftNullInfo.
ConvertedType
.ToTestDisplayString());
5189
Assert.Equal("(System.Byte, System.Int64)", leftNestedTupleInfo.
ConvertedType
.ToTestDisplayString());
5196
Assert.Equal("(System.String, (System.Int64, System.Int64))", rightCastInfo.
ConvertedType
.ToTestDisplayString());
5203
Assert.Equal("(System.String, (System.Int64, System.Byte))", rightTupleInfo.
ConvertedType
.ToTestDisplayString());
CodeGen\CodeGenTupleTest.cs (74)
7573
Assert.Equal("C?", model.GetTypeInfo(tuple1).
ConvertedType
.ToTestDisplayString());
7582
Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(tuple2).
ConvertedType
.ToTestDisplayString());
7591
Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(tuple3).
ConvertedType
.ToTestDisplayString());
7639
Assert.Null(model.GetTypeInfo(tuple).
ConvertedType
);
8296
Assert.Equal("(System.Int16 a, System.String b)?", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8328
Assert.Equal("System.Int32", model.GetTypeInfo(l11).
ConvertedType
.ToTestDisplayString());
8335
Assert.Equal("(System.Int16 c, System.String d)?", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8342
Assert.Equal("System.Int16", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8347
Assert.Equal("System.String", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8353
Assert.Equal("(System.Int16 a, System.String b)?", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
8383
Assert.Equal("(System.Int16 a, System.String b)?", typeInfo.
ConvertedType
.ToTestDisplayString());
8411
Assert.Equal("(System.Int16 a, System.String b)?", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8440
Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8447
Assert.Equal("System.Int16", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8452
Assert.Equal("System.String", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8458
Assert.Equal("(System.Int16 a, System.String b)?", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
8488
Assert.Equal("(System.Object a, System.String b)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8495
Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8522
Assert.Equal("(System.Object a, System.String b)?", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8529
Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8555
Assert.Equal("(System.Int32 a, System.String b)?", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8584
Assert.Equal("(System.Int32 c, System.String d)?", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8591
Assert.Equal("System.Int32", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8596
Assert.Equal("System.String", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8602
Assert.Equal("(System.Int32 a, System.String b)?", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
8631
Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8637
Assert.Equal("(System.Int32 a, System.String b)?", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
8666
Assert.Equal("(System.Int32 a, System.String b)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8695
Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8724
Assert.Equal("(System.Int16 a, System.String b)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8755
Assert.Equal("System.Int32", model.GetTypeInfo(l11).
ConvertedType
.ToTestDisplayString());
8762
Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8769
Assert.Equal("System.Int16", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8774
Assert.Equal("System.String", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8780
Assert.Equal("(System.Int16 a, System.String b)", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
8809
Assert.Equal("(System.Int16 a, System.String b)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8840
Assert.Null(model.GetTypeInfo(lnull).
ConvertedType
);
8847
Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8853
Assert.Equal("(System.Int16 a, System.String b)", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
8898
Assert.Equal("(System.Int16 a, System.String b)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8945
Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
8952
Assert.Equal("System.Int16", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8957
Assert.Equal("System.String", model.GetTypeInfo(element).
ConvertedType
.ToTestDisplayString());
8963
Assert.Equal("(System.Int16 a, System.String b)", model.GetTypeInfo(node.Parent).
ConvertedType
.ToTestDisplayString());
9019
Assert.Equal("C.C1", typeInfo.
ConvertedType
.ToTestDisplayString());
9076
Assert.Equal("C.C1", typeInfo.
ConvertedType
.ToTestDisplayString());
9148
Assert.Equal("C.C1", typeInfo.
ConvertedType
.ToTestDisplayString());
9229
Assert.Equal("C.C1", typeInfo.
ConvertedType
.ToTestDisplayString());
9312
Assert.Equal("C.C1", typeInfo.
ConvertedType
.ToTestDisplayString());
16545
Assert.Equal("(System.Int32, System.String)", typeInfo.
ConvertedType
.ToTestDisplayString());
17216
Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(n1).
ConvertedType
.ToTestDisplayString());
17223
Assert.Null(model.GetTypeInfo(n2).
ConvertedType
);
17230
Assert.Equal("System.Int32", model.GetTypeInfo(n3).
ConvertedType
.ToTestDisplayString());
17237
Assert.Null(model.GetTypeInfo(n4).
ConvertedType
);
17244
Assert.Equal("System.Func<System.Int32>", model.GetTypeInfo(n5).
ConvertedType
.ToTestDisplayString());
17277
Assert.Equal("(System.Int16, System.String)", model.GetTypeInfo(n1).
ConvertedType
.ToTestDisplayString());
17284
Assert.Equal("(System.Int16, System.String)", model.GetTypeInfo(n2).
ConvertedType
.ToTestDisplayString());
17291
Assert.Equal("System.Int16", model.GetTypeInfo(n3).
ConvertedType
.ToTestDisplayString());
17298
Assert.Equal("System.String", model.GetTypeInfo(n4).
ConvertedType
.ToTestDisplayString());
17305
Assert.Equal("System.Func<System.Int32>", model.GetTypeInfo(n5).
ConvertedType
.ToTestDisplayString());
17336
Assert.Equal("(System.Int16, System.String)", model.GetTypeInfo(n1).
ConvertedType
.ToTestDisplayString());
17343
Assert.Equal("(System.Int16, System.String)", model.GetTypeInfo(n2).
ConvertedType
.ToTestDisplayString());
25705
Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(tuple).
ConvertedType
.ToTestDisplayString());
25710
Assert.Equal("System.Int32", model.GetTypeInfo(first).
ConvertedType
.ToTestDisplayString());
25715
Assert.Equal("System.String", model.GetTypeInfo(second).
ConvertedType
.ToTestDisplayString());
25776
Assert.Equal("(System.Int32, System.String)?", model.GetTypeInfo(tuple).
ConvertedType
.ToTestDisplayString());
25781
Assert.Equal("System.Int32", model.GetTypeInfo(first).
ConvertedType
.ToTestDisplayString());
25786
Assert.Equal("System.String", model.GetTypeInfo(second).
ConvertedType
.ToTestDisplayString());
25841
Assert.Equal("(System.Int32, System.String, System.Int32)", model.GetTypeInfo(tuple).
ConvertedType
.ToTestDisplayString());
25846
Assert.Equal("System.Int32?", model.GetTypeInfo(first).
ConvertedType
.ToTestDisplayString());
25851
Assert.Null(model.GetTypeInfo(second).
ConvertedType
);
25883
Assert.Equal("(System.Int32, System.Int32)", model.GetTypeInfo(tuple).
ConvertedType
.ToTestDisplayString());
25913
Assert.Equal("(System.Int32, System.String, System.Int32)", model.GetTypeInfo(tuple).
ConvertedType
.ToTestDisplayString());
26230
Assert.Equal("(System.Int32 A, System.Object B)", tupleSymbol.
ConvertedType
.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\NumericIntPtrTests.cs (1)
6017
Assert.Equal(AsNative(destType), typeInfo.
ConvertedType
.ToString());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (153)
FieldKeywordTests.cs (1)
9479
return (model.GetConstantValue(value).Value, typeInfo.Type.ToTestDisplayString(), typeInfo.
ConvertedType
.ToTestDisplayString());
FirstClassSpanTests.cs (1)
2736
Assert.Equal(targetType, argType.
ConvertedType
.ToTestDisplayString());
Semantics\CollectionExpressionTests.cs (20)
14314
Assert.Equal("MyCollection<System.Int32>?", typeInfo.
ConvertedType
.ToTestDisplayString());
14390
Assert.Equal("MyCollection<System.Byte>?", typeInfo.
ConvertedType
.ToTestDisplayString());
14455
Assert.Equal("System.Int32?", typeInfo.
ConvertedType
.ToTestDisplayString());
14524
Assert.Null(typeInfo.
ConvertedType
);
14649
Assert.Null(typeInfo.
ConvertedType
);
14729
Assert.Equal("System.Int32[]", typeInfo.
ConvertedType
.ToTestDisplayString());
14824
Assert.Equal("MyCollection<System.Int32>?", typeInfo.
ConvertedType
.ToTestDisplayString());
15167
Assert.Equal(expectedConvertedType, typeInfo.
ConvertedType
?.ToTestDisplayString());
28704
Assert.Equal("System.Int32[]", typeInfo2.
ConvertedType
.ToTestDisplayString());
28748
Assert.Equal("System.Int32[]", typeInfo2.
ConvertedType
.ToTestDisplayString());
28838
Assert.Equal("System.Int32[]", typeInfo2.
ConvertedType
.ToTestDisplayString());
28881
Assert.Equal("System.Int32[]", typeInfo2.
ConvertedType
.ToTestDisplayString());
29031
Assert.Equal("T2", typeInfo2.
ConvertedType
.ToTestDisplayString());
29039
Assert.Equal("T3", typeInfo3.
ConvertedType
.ToTestDisplayString());
29084
Assert.Equal("T2", typeInfo2.
ConvertedType
.ToTestDisplayString());
29092
Assert.Equal("T3", typeInfo3.
ConvertedType
.ToTestDisplayString());
29148
Assert.Equal("T2", typeInfo2.
ConvertedType
.ToTestDisplayString());
29155
Assert.Equal("T3", typeInfo3.
ConvertedType
.ToTestDisplayString());
29209
Assert.Equal("T2", typeInfo2.
ConvertedType
.ToTestDisplayString());
29216
Assert.Equal("T3", typeInfo3.
ConvertedType
.ToTestDisplayString());
Semantics\InlineArrayTests.cs (21)
2365
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
2400
Assert.Equal("System.Index", typeInfo.
ConvertedType
.ToTestDisplayString());
2434
Assert.Equal("System.Range", typeInfo.
ConvertedType
.ToTestDisplayString());
2514
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
2524
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
6039
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
6205
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
6215
Assert.Equal("System.Span<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
8841
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
8851
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
9209
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
10553
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
10563
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
11297
Assert.Equal("Buffer10<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
11307
Assert.Equal("System.ReadOnlySpan<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
15214
Assert.Equal("System.ReadOnlySpan<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
15221
Assert.Equal("System.Span<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
16501
Assert.Equal("System.ReadOnlySpan<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
18589
Assert.Equal("Buffer4<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
18915
Assert.Equal("Buffer4<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
19252
Assert.Equal("Buffer4<System.Int32>", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\OutVarTests.cs (9)
1026
Assert.Equal(expectedType, typeInfo.
ConvertedType
);
1054
Assert.Equal(expected, typeInfo.
ConvertedType
);
33027
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
33043
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
33099
Assert.Equal("System.Int64", typeInfo.
ConvertedType
.ToTestDisplayString());
33141
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
33157
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
33205
Assert.Equal("alias1", typeInfo.
ConvertedType
.ToTestDisplayString());
33223
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
Semantics\ParamsCollectionTests.cs (8)
176
Assert.Equal("System.Int64", typeInfo.
ConvertedType
.ToTestDisplayString());
232
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
348
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
531
Assert.Equal("System.Char", typeInfo.
ConvertedType
.ToTestDisplayString());
676
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
1420
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
2544
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
2680
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\PatternMatchingTestBase.cs (3)
135
Assert.Equal(expectedType, typeInfo.
ConvertedType
);
387
Assert.Equal(type, typeInfo.
ConvertedType
);
392
Assert.Equal(SymbolKind.ErrorType, typeInfo.
ConvertedType
.Kind);
Semantics\PatternMatchingTests.cs (2)
6576
Assert.Equal("System.Int32", model.GetTypeInfo(caseDefault.Pattern).
ConvertedType
.ToTestDisplayString());
11371
Assert.Equal(SpecialType.System_String, typeInfo.
ConvertedType
.SpecialType);
Semantics\PatternMatchingTests_ListPatterns.cs (9)
3650
Assert.Null(typeInfo.
ConvertedType
);
3653
Assert.Equal(type, typeInfo.
ConvertedType
.ToDisplayString());
3692
Assert.Equal(type, typeInfo.
ConvertedType
.ToDisplayString());
3731
Assert.Null(typeInfo.
ConvertedType
);
3735
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
3746
Assert.Null(typeInfo.
ConvertedType
);
3750
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4420
Assert.Null(typeInfo.
ConvertedType
);
4423
Assert.Equal(type, typeInfo.
ConvertedType
.ToDisplayString());
Semantics\PatternMatchingTests2.cs (16)
2166
Assert.Equal(ex.ConvertedType, typeInfo.
ConvertedType
.ToTestDisplayString());
2257
Assert.Equal("T2", ti.
ConvertedType
.ToTestDisplayString());
2262
Assert.Equal("T3", ti.
ConvertedType
.ToTestDisplayString());
2267
Assert.Equal("T4", ti.
ConvertedType
.ToTestDisplayString());
2272
Assert.Equal("T6", ti.
ConvertedType
.ToTestDisplayString());
2301
Assert.Equal("Point", ti.
ConvertedType
.ToTestDisplayString());
2306
Assert.Equal("System.Int32", ti.
ConvertedType
.ToTestDisplayString());
2311
Assert.Equal("System.Double", ti.
ConvertedType
.ToTestDisplayString());
2347
Assert.Equal("Point", ti.
ConvertedType
.ToTestDisplayString());
2353
Assert.Equal("System.Int32", ti.
ConvertedType
.ToTestDisplayString());
2359
Assert.Equal("System.Double", ti.
ConvertedType
.ToTestDisplayString());
2365
Assert.Equal("?", ti.
ConvertedType
.ToTestDisplayString());
2366
Assert.Equal(TypeKind.Error, ti.
ConvertedType
.TypeKind);
2371
Assert.Equal("Q7", ti.
ConvertedType
.ToTestDisplayString());
2372
Assert.Equal(TypeKind.Error, ti.
ConvertedType
.TypeKind);
2877
Assert.Equal(expectedConvertedType, typeInfo.
ConvertedType
?.ToTestDisplayString());
Semantics\PatternMatchingTests3.cs (56)
4119
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4125
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4133
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4135
Assert.Equal("System.Int32", model.GetTypeInfo(((ConstantPatternSyntax)pattern).Expression).
ConvertedType
.ToTestDisplayString());
4141
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4147
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4154
Assert.Equal("System.Int64", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4162
Assert.Equal("System.Int64", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4168
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4177
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4183
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4190
Assert.Equal("System.Int64", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4197
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4203
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4209
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4215
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4222
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4229
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4235
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4241
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4248
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4255
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4261
Assert.Equal("System.Object", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4267
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4273
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4280
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4287
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4346
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4352
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4360
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4362
Assert.Equal("System.Int32", model.GetTypeInfo(((ConstantPatternSyntax)pattern).Expression).
ConvertedType
.ToTestDisplayString());
4368
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4374
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4381
Assert.Equal("System.Int64", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4389
Assert.Equal("System.Int64", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4395
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4397
Assert.Equal("System.Int32", model.GetTypeInfo(((ConstantPatternSyntax)pattern).Expression).
ConvertedType
.ToTestDisplayString());
4403
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4411
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4417
Assert.Equal("System.Runtime.CompilerServices.ITuple", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4424
Assert.Equal("System.Int64", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4431
Assert.Equal("System.Int32", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4437
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4443
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4449
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4456
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4463
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4469
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4475
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4482
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4489
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4495
Assert.Equal("System.Object", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4501
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4507
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4514
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
4521
Assert.Equal("System.Char", model.GetTypeInfo(pattern).
ConvertedType
.ToTestDisplayString());
Semantics\PatternMatchingTests5.cs (6)
1300
Assert.Equal("C", xyType.
ConvertedType
.ToTestDisplayString());
1308
Assert.Equal("S?", xType.
ConvertedType
.ToTestDisplayString());
1316
Assert.Equal("C", yNameType.
ConvertedType
.ToTestDisplayString());
1327
Assert.Equal("S?", yxType.
ConvertedType
.ToTestDisplayString());
1335
Assert.Equal("C", yType.
ConvertedType
.ToTestDisplayString());
1343
Assert.Equal("S?", xNameType.
ConvertedType
.ToTestDisplayString());
Semantics\PatternSwitchTests.cs (1)
3289
Assert.Equal(SpecialType.System_Boolean, type.
ConvertedType
.SpecialType);
Microsoft.CodeAnalysis.CSharp.Features (43)
ChangeSignature\CSharpChangeSignatureService.cs (1)
869
var convertedType = (ISymbol?)semanticModel.GetTypeInfo(node, cancellationToken).
ConvertedType
;
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
59
var propertyPatternType = semanticModel.GetTypeInfo((PatternSyntax)propertyPatternClause.Parent!, cancellationToken).
ConvertedType
;
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (5)
522
? _semanticModel.GetTypeInfo(expression, _cancellationToken).
ConvertedType
.GenerateTypeSyntax()
561
if (returnTypeInfo.
ConvertedType
.OriginalDefinition?.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T)
563
returnedType = returnTypeInfo.
ConvertedType
;
667
if (Equals(lastSelectExpressionTypeInfo.
ConvertedType
, lastSelectExpressionTypeInfo.Type) &&
668
Equals(lastSelectExpressionTypeInfo.
ConvertedType
, forEachStatementTypeSymbolType))
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
49
: info.
ConvertedType
;
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (6)
99
if (info.
ConvertedType
== null || info.
ConvertedType
.IsErrorType())
120
info.
ConvertedType
?.IsFormattableStringOrIFormattable() == true)
134
info.
ConvertedType
== null ||
135
info.
ConvertedType
.TypeKind != TypeKind.Interface)
141
return info.
ConvertedType
.GetAttributes().Any(static (c, coclassSymbol) => c.AttributeClass?.Equals(coclassSymbol) == true, coclassSymbol);
InlineHints\CSharpInlineTypeHintsService.cs (1)
109
var type = semanticModel.GetTypeInfo(collectionExpression, cancellationToken).
ConvertedType
;
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
126
if (document.SemanticModel.GetTypeInfo(oldLambda, cancellationToken).
ConvertedType
is INamedTypeSymbol delegateType &&
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (4)
127
if (lambdaTypeInfo.
ConvertedType
== null || lambdaTypeInfo.
ConvertedType
.SpecialType is SpecialType.System_Object)
217
var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).
ConvertedType
;
218
if (!lambdaTypeInfo.
ConvertedType
.Equals(rewrittenConvertedType))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
97
var convertedType = semanticModel.GetTypeInfo(expression.WalkUpParentheses(), cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (8)
96
if (originalTypeInfo.
ConvertedType
is null or IErrorTypeSymbol)
99
if (!IsConstructibleCollectionType(compilation, originalTypeInfo.
ConvertedType
.OriginalDefinition))
111
!originalTypeInfo.Type.Equals(originalTypeInfo.
ConvertedType
) &&
161
if (!originalTypeInfo.
ConvertedType
.Equals(replacedTypeInfo.
ConvertedType
) &&
162
!s_arrayAndReadOnlySpanCompareEquallyComparer.Equals(originalTypeInfo.
ConvertedType
, replacedTypeInfo.
ConvertedType
))
173
var convertedType = originalTypeInfo.
ConvertedType
;
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
42
if (semanticModel.GetTypeInfo(declaration, cancellationToken).
ConvertedType
is not INamedTypeSymbol lambdaType || lambdaType.DelegateInvokeMethod == null)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
114
var delegateType = semanticModel.GetTypeInfo(anonymousFunction, cancellationToken).
ConvertedType
as INamedTypeSymbol;
297
var convertedType = semanticModel.GetTypeInfo(nodeToCheck, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (5)
193
if (typeInfo.
ConvertedType
is not null &&
195
!Equals(typeInfo.
ConvertedType
, typeInfo.Type))
197
var conversion = _semanticModel.Compilation.ClassifyConversion(typeInfo.Type, typeInfo.
ConvertedType
);
199
return node.Cast(typeInfo.
ConvertedType
);
263
var expressionConvertedType = _semanticModel.GetTypeInfo(node.Expression).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
174
typeToGenerateIn = document.SemanticModel.GetTypeInfo(expression, cancellationToken).
ConvertedType
as INamedTypeSymbol;
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
84
var type = semanticModel.GetTypeInfo(defaultLiteral, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
46
var type = semanticModel.GetTypeInfo(variableDeclaration.Type, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
81
var lambdaType = (INamedTypeSymbol)semanticModel.GetTypeInfo(declaration).
ConvertedType
!;
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
220
var typeSymbol = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).
ConvertedType
;
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
101
var delegateType = (INamedTypeSymbol)semanticModel.GetTypeInfo(anonymousFunction, cancellationToken).
ConvertedType
;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_IConversionExpression.cs (2)
180
Assert.Null(typeInfo.
ConvertedType
);
5386
Assert.Equal(conversion.Type, typeInfo.
ConvertedType
);
IOperation\IOperationTests_IVariableDeclaration.cs (2)
931
Assert.Equal("System.Int32", model.GetTypeInfo(literalExpr).
ConvertedType
.ToTestDisplayString());
938
Assert.Equal("System.Int32", model.GetTypeInfo(invocExpr).
ConvertedType
.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (457)
Semantics\ConditionalOperatorTests.cs (2)
1304
Assert.Equal(expectedType, model.GetTypeInfo(conditionalExpr.WhenTrue).
ConvertedType
.ToTestDisplayString()); //in parent to catch conversion
1305
Assert.Equal(expectedType, model.GetTypeInfo(conditionalExpr.WhenFalse).
ConvertedType
.ToTestDisplayString()); //in parent to catch conversion
Semantics\DeconstructionTests.cs (90)
4262
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4270
Assert.Equal("(var a, var b)", typeInfo.
ConvertedType
.ToTestDisplayString());
4271
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4286
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4292
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4303
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4308
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4317
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4397
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4405
Assert.Equal("(var a, var b)", typeInfo.
ConvertedType
.ToTestDisplayString());
4417
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4423
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4434
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4439
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4448
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4521
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4529
Assert.Equal("(var, var)", typeInfo.
ConvertedType
.ToTestDisplayString());
4530
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4545
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4554
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4565
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4573
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4582
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4671
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4679
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4690
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4695
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4765
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4773
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4784
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4789
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4843
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4851
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4862
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4870
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4947
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4952
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4993
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4998
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5051
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5059
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5211
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5219
Assert.Equal("(var a, var b)", typeInfo.
ConvertedType
.ToTestDisplayString());
5231
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5237
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5248
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5253
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5265
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5275
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5355
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5363
Assert.Equal("(var a, var b)", typeInfo.
ConvertedType
.ToTestDisplayString());
5375
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5381
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5392
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5397
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5409
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5419
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5492
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5500
Assert.Equal("(var, var)", typeInfo.
ConvertedType
.ToTestDisplayString());
5512
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5521
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5532
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5540
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5552
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5562
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5679
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5687
Assert.Equal("((var a, var b), var c)", typeInfo.
ConvertedType
.ToTestDisplayString());
5698
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5703
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5712
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5789
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5797
Assert.Equal("((var a, var b), var c)", typeInfo.
ConvertedType
.ToTestDisplayString());
5808
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5813
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5822
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5892
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5900
Assert.Equal("((var, var), var)", typeInfo.
ConvertedType
.ToTestDisplayString());
5911
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5919
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5928
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
5989
Assert.Equal(SpecialType.System_Void, type.
ConvertedType
.SpecialType);
6000
Assert.Null(type.
ConvertedType
);
6032
Assert.Equal(SpecialType.System_Void, type.
ConvertedType
.SpecialType);
6043
Assert.Null(type.
ConvertedType
);
6072
Assert.Equal(SpecialType.System_Void, type.
ConvertedType
.SpecialType);
6083
Assert.Null(type.
ConvertedType
);
6114
Assert.Equal(SpecialType.System_Int32, type.
ConvertedType
.SpecialType);
6125
Assert.Null(type.
ConvertedType
);
6154
Assert.Equal(SpecialType.System_Void, type.
ConvertedType
.SpecialType);
6165
Assert.Null(type.
ConvertedType
);
Semantics\DelegateTypeTests.cs (47)
752
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
799
Assert.Null(typeInfo.
ConvertedType
);
898
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
941
Assert.Equal(expectedDisplayString, typeInfo.
ConvertedType
?.ToTestDisplayString());
1006
Assert.Equal("System.Linq.Expressions.Expression", typeInfo.
ConvertedType
!.ToTestDisplayString());
1041
Assert.Null(typeInfo.
ConvertedType
);
1045
Assert.Equal($"System.Linq.Expressions.Expression<{expectedType}>", typeInfo.
ConvertedType
.ToTestDisplayString());
1214
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1250
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1335
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1375
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1418
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1462
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1557
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1637
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1687
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1737
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1787
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1837
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1887
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1937
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
1983
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
2031
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
2085
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2150
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2212
Assert.True(typeInfo.
ConvertedType
!.IsErrorType());
2271
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2320
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2359
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2402
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2454
Assert.True(typeInfo.
ConvertedType
!.IsErrorType());
2495
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2543
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2595
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2641
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2689
Assert.Equal("System.Action", typeInfo.
ConvertedType
!.ToTestDisplayString());
2736
Assert.True(typeInfo.
ConvertedType
!.IsErrorType());
3565
Assert.Equal("System.Delegate", typeInfo1.
ConvertedType
!.ToTestDisplayString());
3572
Assert.Equal("System.Delegate", typeInfo2.
ConvertedType
!.ToTestDisplayString());
3610
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
8031
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
8054
Assert.Equal(SpecialType.System_Delegate, typeInfo.
ConvertedType
!.SpecialType);
10399
return (symbol?.ToTestDisplayString(), typeInfo.Type?.ToTestDisplayString(), typeInfo.
ConvertedType
?.ToTestDisplayString());
19766
Assert.Equal("System.Func<?>[]", typeInfo.
ConvertedType
.ToTestDisplayString());
19770
Assert.Equal("System.Func<?>", typeInfo.
ConvertedType
.ToTestDisplayString());
19808
Assert.Equal("?[]", typeInfo.
ConvertedType
.ToTestDisplayString());
19812
Assert.Equal("?", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\DynamicTests.cs (169)
4991
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5115
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5238
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5352
Assert.True(typeInfo.
ConvertedType
.IsErrorType());
5393
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5437
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5481
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5525
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5702
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5743
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5788
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5833
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
5878
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6036
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6159
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6279
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6387
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6429
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6476
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6520
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6565
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6574
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6619
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6685
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6693
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6703
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
6794
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6802
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6812
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
6904
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6912
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
6922
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7001
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7009
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7019
AssertEx.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString());
7073
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7081
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7086
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
7176
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7184
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7197
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
7289
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7297
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7310
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
7405
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7413
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7426
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7518
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7527
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7541
AssertEx.Equal("C2", typeInfo.
ConvertedType
.ToTestDisplayString());
7595
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7603
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7610
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
7700
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7708
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7806
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7814
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7910
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7919
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
7981
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
7989
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8087
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8095
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8192
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8200
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8297
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8305
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8315
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8406
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8414
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8424
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8515
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8523
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8533
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8625
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8633
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8643
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8734
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8742
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8752
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8803
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8811
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8821
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8875
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8883
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8893
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8931
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8939
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
8949
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9021
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9029
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9039
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9112
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9120
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9130
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9202
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9210
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9220
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9258
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9266
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9276
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9319
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9327
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9440
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9448
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9560
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9568
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9674
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9682
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9785
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9793
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9896
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
9904
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10027
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10035
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
10040
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10052
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10057
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10155
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10163
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
10168
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10180
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10185
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10283
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10291
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
10296
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10308
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10313
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10437
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10445
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
10450
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10462
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10467
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10571
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10579
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
10584
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10596
AssertEx.Equal("C2", typeInfo.
ConvertedType
.ToTestDisplayString());
10719
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10727
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
10732
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
10744
AssertEx.Equal("C2", typeInfo.
ConvertedType
.ToTestDisplayString());
10989
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
10997
AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.
ConvertedType
.ToTestDisplayString());
11002
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11014
AssertEx.Equal("C2", typeInfo.
ConvertedType
.ToTestDisplayString());
11110
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11115
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11120
AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11125
AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11132
AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11137
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11142
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11194
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11199
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11204
AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11209
AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11216
AssertEx.Equal("(C2, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11221
AssertEx.Equal("C2", typeInfo.
ConvertedType
.ToTestDisplayString());
11272
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11277
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11282
AssertEx.Equal("(dynamic, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString());
11332
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11385
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11461
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11505
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11546
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11598
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11650
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
11690
AssertEx.Equal("dynamic", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\ForEachTests.cs (1)
2145
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
Semantics\FunctionPointerTests.cs (8)
211
Assert.True(typeInfo.
ConvertedType
is IPointerTypeSymbol { PointedAtType: { SpecialType: SpecialType.System_Void } });
218
var classifiedConversion = comp.ClassifyConversion(typeInfo.Type, typeInfo.
ConvertedType
!);
298
Assert.Equal(TypeKind.FunctionPointer, typeInfo.
ConvertedType
!.TypeKind);
303
var classifiedConversion = model.ClassifyConversion(literal, typeInfo.
ConvertedType
);
609
var classifiedConversion = comp.ClassifyConversion(typeInfo.Type!, typeInfo.
ConvertedType
!);
850
var classifiedConversion = comp.ClassifyConversion(typeInfo.Type!, typeInfo.
ConvertedType
!);
908
AssertEx.Equal(expectedConvertedType, typeInfo.
ConvertedType
!.ToTestDisplayString());
909
var classifiedConversion = comp.ClassifyConversion(typeInfo.Type!, typeInfo.
ConvertedType
!);
Semantics\ImplicitlyTypeArraysTests.cs (2)
73
Assert.NotNull(info.
ConvertedType
);
101
Assert.NotNull(typeInfo.
ConvertedType
);
Semantics\ImplicitObjectCreationTests.cs (21)
66
Assert.Equal(convertedType, model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
141
Assert.Equal(convertedType, model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
188
Assert.Equal(convertedType, model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
240
Assert.Equal(convertedType, model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
846
Assert.Equal("InterfaceType", model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
887
Assert.Equal("NonGenericInterfaceType", model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
1716
Assert.Equal(convertedType, model.GetTypeInfo(invocation).
ConvertedType
.ToTestDisplayString());
1870
Assert.Equal("C", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
1900
Assert.Equal("S", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
1930
Assert.Equal("S?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
1983
Assert.Equal("S", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
2041
Assert.Equal("System.Object", model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
2048
Assert.Equal("System.Object", model.GetTypeInfo(newObject).
ConvertedType
.ToTestDisplayString());
2076
Assert.Equal("System.Object", model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
2083
Assert.Equal("System.Object", model.GetTypeInfo(newObject).
ConvertedType
.ToTestDisplayString());
2135
Assert.Equal(convertedType, model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
2222
Assert.Equal("T", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
2518
Assert.Equal("System.Exception", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
2570
Assert.Equal("C", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
2933
Assert.Equal(convertedType, model.GetTypeInfo(@new).
ConvertedType
.ToTestDisplayString());
4198
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\IteratorTests.cs (2)
619
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
657
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
Semantics\LambdaTests.cs (3)
1983
Assert.Equal("void System.EventHandler.Invoke(System.Object sender, System.EventArgs e)", model.GetTypeInfo(node1).
ConvertedType
.GetMembers("Invoke").Single().ToTestDisplayString());
3950
Assert.Equal(expectedAttributeType, typeInfo.
ConvertedType
);
5648
Assert.Equal(expectedType, typeInfo.
ConvertedType
);
Semantics\LockTests.cs (2)
712
Assert.NotNull(typeInfo.
ConvertedType
);
715
Assert.Equal(symbol, typeInfo.
ConvertedType
.GetSymbol());
Semantics\NativeIntegerTests.cs (1)
9507
Assert.Equal(destType, typeInfo.
ConvertedType
.ToString());
Semantics\NullableReferenceTypesTests.cs (10)
56079
Assert.Equal("System.Object?", model.GetTypeInfo(nullNode).
ConvertedType
.ToTestDisplayString());
56109
Assert.Equal("System.Object?", model.GetTypeInfo(nullNode).
ConvertedType
.ToTestDisplayString());
56142
Assert.Equal("U?", model.GetTypeInfo(defaultNode).
ConvertedType
.ToTestDisplayString());
56179
Assert.Equal("U", model.GetTypeInfo(defaultNode).
ConvertedType
.ToTestDisplayString());
56307
Assert.Equal("System.Object?", model.GetTypeInfo(nullNode).
ConvertedType
.ToTestDisplayString());
56440
Assert.Equal("System.Object", model.GetTypeInfo(newNode).
ConvertedType
.ToTestDisplayString());
56475
Assert.Equal("Program", model.GetTypeInfo(newNode).
ConvertedType
.ToTestDisplayString());
56511
Assert.Equal("System.Object?", model.GetTypeInfo(nullNode).
ConvertedType
.ToTestDisplayString());
56622
Assert.Equal("System.Action", model.GetTypeInfo(lambdaNode).
ConvertedType
.ToTestDisplayString());
59025
Assert.Equal("System.String?", model.GetTypeInfo(declaration.Type).
ConvertedType
.ToTestDisplayString());
Semantics\NullCoalesceAssignmentTests.cs (6)
50
Assert.Equal(cType.GetPublicSymbol(), typeInfo.
ConvertedType
);
84
Assert.Equal(cType, whenNullTypeInfo.
ConvertedType
.GetSymbol());
92
Assert.Equal(cType.GetPublicSymbol(), typeInfo.
ConvertedType
);
124
Assert.Equal(cType.GetPublicSymbol(), whenNullTypeInfo.
ConvertedType
);
135
Assert.Equal(dType, typeInfo.
ConvertedType
.GetSymbol());
187
Assert.Equal(SpecialType.System_Int32, semanticModel.GetTypeInfo(defaultLiteral).
ConvertedType
.SpecialType);
Semantics\ObjectAndCollectionInitializerTests.cs (11)
3821
Assert.Same(typeInfo.Type, typeInfo.
ConvertedType
);
3845
Assert.Equal(SpecialType.System_Object, typeInfo.
ConvertedType
.SpecialType);
3869
Assert.Equal(SpecialType.System_Object, typeInfo.
ConvertedType
.SpecialType);
4100
Assert.Equal(SpecialType.System_Int32, typeInfo.
ConvertedType
.SpecialType);
4172
Assert.Equal("I", typeInfo.
ConvertedType
.ToDisplayString());
4232
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4241
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4251
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4286
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4295
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
4305
AssertEx.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\OperatorTests.cs (2)
7061
Assert.Equal(comp.GetSpecialType(SpecialType.System_Boolean), info.
ConvertedType
.GetSymbol());
7216
Assert.Equal(comp.GetSpecialType(SpecialType.System_Boolean).GetPublicSymbol(), info.
ConvertedType
);
Semantics\RefEscapingTests.cs (8)
5721
Assert.Equal("(System.Span<int>, string)", model.GetTypeInfo(tuple2).
ConvertedType
.ToString());
5727
Assert.Equal("(System.Span<int>, string)", model.GetTypeInfo(tuple3).
ConvertedType
.ToString());
5733
Assert.Equal("(C, string)", model.GetTypeInfo(tuple6).
ConvertedType
.ToString());
5739
Assert.Equal("(C, string)", model.GetTypeInfo(tuple7).
ConvertedType
.ToString());
5821
Assert.Equal("(System.Span<int>, string)", model.GetTypeInfo(tuple2).
ConvertedType
.ToString());
5827
Assert.Equal("(System.Span<int>, string)", model.GetTypeInfo(tuple3).
ConvertedType
.ToString());
5833
Assert.Equal("(C, string)", model.GetTypeInfo(tuple6).
ConvertedType
.ToString());
5839
Assert.Equal("(C, string)", model.GetTypeInfo(tuple7).
ConvertedType
.ToString());
Semantics\TargetTypedConditionalOperatorTests.cs (5)
359
Assert.Equal(convertedType, model.GetTypeInfo(conditionalExpr).
ConvertedType
.ToTestDisplayString(includeNonNullable: false));
364
Assert.Equal(convertedType, model.GetTypeInfo(conditionalExpr.WhenTrue).
ConvertedType
.ToTestDisplayString(includeNonNullable: false)); //in parent to catch conversion
365
Assert.Equal(convertedType, model.GetTypeInfo(conditionalExpr.WhenFalse).
ConvertedType
.ToTestDisplayString(includeNonNullable: false)); //in parent to catch conversion
671
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString());
692
Assert.Equal("System.Int32?", typeInfo.
ConvertedType
.ToTestDisplayString());
Semantics\TargetTypedDefaultTests.cs (43)
46
Assert.Equal("System.Int32", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
146
Assert.Equal("System.Int32", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
199
Assert.Equal("S", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
247
Assert.Equal("System.Object", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
256
Assert.Equal("System.Object", model.GetTypeInfo(nullSyntax).
ConvertedType
.ToTestDisplayString());
284
Assert.Equal("System.Object", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
293
Assert.Equal("System.Object", model.GetTypeInfo(nullSyntax).
ConvertedType
.ToTestDisplayString());
329
Assert.Equal("T", model.GetTypeInfo(default1).
ConvertedType
.ToTestDisplayString());
335
Assert.Equal("?", model.GetTypeInfo(default2).
ConvertedType
.ToTestDisplayString());
523
Assert.Equal("?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
532
Assert.Null(model.GetTypeInfo(nullSyntax).
ConvertedType
); // Should get a converted type https://github.com/dotnet/roslyn/issues/37798
569
Assert.Equal("?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
578
Assert.Null(model.GetTypeInfo(nullSyntax).
ConvertedType
); // Should get a converted type https://github.com/dotnet/roslyn/issues/37798
612
Assert.Equal("?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
621
Assert.Null(model.GetTypeInfo(nullSyntax).
ConvertedType
); // Should get a converted type https://github.com/dotnet/roslyn/issues/37798
670
Assert.Equal("T", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
751
Assert.Equal("?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
760
Assert.Null(model.GetTypeInfo(nullSyntax).
ConvertedType
); // Should get a converted type https://github.com/dotnet/roslyn/issues/37798
839
Assert.Equal("S", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
868
Assert.Equal("T", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
1145
Assert.Equal("System.Int32", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
1744
Assert.Null(model.GetTypeInfo(@default).
ConvertedType
);
1749
Assert.Equal(semanticType, model.GetTypeInfo(@default).
ConvertedType
.ToTestDisplayString());
1808
Assert.Equal(semanticType, model.GetTypeInfo(@default).
ConvertedType
.ToTestDisplayString());
1879
Assert.Equal(semanticType, model.GetTypeInfo(@default).
ConvertedType
.ToTestDisplayString());
1914
Assert.Equal("S", model.GetTypeInfo(first).
ConvertedType
.ToTestDisplayString());
2092
Assert.Equal("?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
2336
Assert.Equal("System.Object[]", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
2342
Assert.Equal("System.Object[]", model.GetTypeInfo(nullSyntax).
ConvertedType
.ToTestDisplayString());
2417
Assert.Equal("System.Object[]", model.GetTypeInfo(first).
ConvertedType
.ToTestDisplayString());
2422
Assert.Equal("System.Object", model.GetTypeInfo(second).
ConvertedType
.ToTestDisplayString());
2427
Assert.Equal("S[]", model.GetTypeInfo(third).
ConvertedType
.ToTestDisplayString());
2432
Assert.Equal("S", model.GetTypeInfo(fourth).
ConvertedType
.ToTestDisplayString());
2460
Assert.Equal("System.Int32", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
3057
Assert.Equal("System.Int32?", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
3347
Assert.Equal("C", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
3386
Assert.Equal("D", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
3519
Assert.Equal("System.Int16", model.GetTypeInfo(def).
ConvertedType
.ToTestDisplayString());
3527
Assert.Equal("System.Int32", conversionTypeInfo.
ConvertedType
.ToTestDisplayString());
3577
Assert.Equal("System.Int32?", model.GetTypeInfo(default1).
ConvertedType
.ToTestDisplayString());
3585
Assert.Equal("System.Int32?", model.GetTypeInfo(default2).
ConvertedType
.ToTestDisplayString());
3592
Assert.Equal("System.Int32?", model.GetTypeInfo(default3).
ConvertedType
.ToTestDisplayString());
3599
Assert.Equal("System.Int32?", model.GetTypeInfo(default4).
ConvertedType
.ToTestDisplayString());
Semantics\TopLevelStatementsTests.cs (4)
255
Assert.Null(typeInfo.
ConvertedType
);
266
Assert.Null(typeInfo.
ConvertedType
);
406
Assert.Null(typeInfo.
ConvertedType
);
417
Assert.Null(typeInfo.
ConvertedType
);
Semantics\UnsafeTests.cs (7)
7269
Assert.Equal(type, typeInfo.
ConvertedType
);
7336
Assert.Equal(type, typeInfo.
ConvertedType
);
7374
Assert.Equal(type, typeInfo.
ConvertedType
);
7416
Assert.Equal(type, typeInfo.
ConvertedType
);
7547
Assert.Equal(type, typeInfo.
ConvertedType
);
8351
Assert.Equal(TypeKind.Pointer, typeInfo.
ConvertedType
.TypeKind);
8390
var convertedType = typeInfo.
ConvertedType
;
Semantics\Utf8StringsLiteralsTests.cs (13)
2977
Assert.Equal("System.Byte[]", typeInfo.
ConvertedType
.ToTestDisplayString());
3005
Assert.Equal("System.Byte[]", typeInfo.
ConvertedType
.ToTestDisplayString());
3033
Assert.Equal("System.Span<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3061
Assert.Equal("System.Span<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3089
Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3117
Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3145
Assert.Equal("System.Byte[]", typeInfo.
ConvertedType
.ToTestDisplayString());
3173
Assert.Equal("System.Byte[]", typeInfo.
ConvertedType
.ToTestDisplayString());
3201
Assert.Equal("System.Span<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3229
Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3257
Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.
ConvertedType
.ToTestDisplayString());
3285
Assert.Equal("System.ReadOnlySpan<System.Char>", typeInfo.
ConvertedType
.ToTestDisplayString());
3313
Assert.Equal("System.ReadOnlySpan<System.Char>", typeInfo.
ConvertedType
.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (93)
Compilation\GetSemanticInfoTests.cs (41)
79
Assert.NotNull(info.
ConvertedType
);
111
Assert.NotNull(info.
ConvertedType
);
112
Assert.Equal("Test.D", info.
ConvertedType
.ToTestDisplayString());
145
Assert.NotNull(info.
ConvertedType
);
146
Assert.Equal("Test.D", info.
ConvertedType
.ToTestDisplayString());
194
Assert.NotNull(info.
ConvertedType
);
303
ConversionTestHelper(model, ((CastExpressionSyntax)arg).Expression, model.GetTypeInfo(arg).
ConvertedType
, ck);
602
Assert.NotNull(info.
ConvertedType
);
606
Conversion conv = model.ClassifyConversion(expr1, info.
ConvertedType
);
611
conv = model.ClassifyConversion(expr2, info.
ConvertedType
);
633
Assert.NotNull(info.
ConvertedType
);
638
Conversion conv = model.ClassifyConversion(expr1, info.
ConvertedType
);
648
var conversion = info.Type != null && info.
ConvertedType
!= null ? model.Compilation.ClassifyConversion(info.Type, info.
ConvertedType
) : Conversion.NoConversion;
649
Assert.Equal(conversion.IsImplicit, model.Compilation.HasImplicitConversion(info.Type, info.
ConvertedType
));
846
Assert.NotNull(info.
ConvertedType
);
850
Conversion act1 = semanticModel.ClassifyConversion(expr, info.
ConvertedType
);
863
var act2 = semanticModel.Compilation.ClassifyConversion(info.Type, info.
ConvertedType
);
873
Assert.NotNull(info.
ConvertedType
);
2405
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
2416
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString());
2422
Assert.Equal("System.Byte", typeInfo.
ConvertedType
.ToTestDisplayString());
2428
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString());
2459
Assert.Equal(SpecialType.System_Double, info.
ConvertedType
.SpecialType);
2488
Assert.Equal(SpecialType.System_Int32, info.
ConvertedType
.SpecialType);
2512
Assert.Equal(SpecialType.System_Int32, info.
ConvertedType
.SpecialType);
2733
Assert.Equal(type, typeInfo.
ConvertedType
);
2804
Assert.Equal(returnType, typeInfo.
ConvertedType
);
3475
Assert.Equal("A", argTypeInfo.
ConvertedType
.ToTestDisplayString());
3529
Assert.Equal("B<A>", argTypeInfo.
ConvertedType
.ToTestDisplayString());
3588
Assert.Equal("System.IntPtr", argTypeInfo.
ConvertedType
.ToTestDisplayString());
3612
Assert.Equal(SpecialType.System_Object, literalTypeInfo.
ConvertedType
.SpecialType);
3637
Assert.Equal(SpecialType.System_Int32, literalTypeInfo.
ConvertedType
.SpecialType);
3645
Assert.Equal(SpecialType.System_Object, castTypeInfo.
ConvertedType
.SpecialType);
3670
Assert.Equal(SpecialType.System_Int32, literalTypeInfo.
ConvertedType
.SpecialType);
3678
Assert.Equal(SpecialType.System_Object, castTypeInfo.
ConvertedType
.SpecialType);
3706
Assert.Equal(SpecialType.System_Int32, literalTypeInfo.
ConvertedType
.SpecialType);
3714
Assert.Equal(SpecialType.System_Int64, cast1TypeInfo.
ConvertedType
.SpecialType);
3726
Assert.Equal(SpecialType.System_Object, cast2TypeInfo.
ConvertedType
.SpecialType);
5527
Assert.NotEqual(otherFuncType, typeInfo.
ConvertedType
);
5543
Assert.NotEqual(otherFuncType, typeInfo.
ConvertedType
); // Not affected by call to ClassifyConversion.
Compilation\SemanticModelAPITests.cs (19)
1435
Assert.Equal("Object", typeInfo.
ConvertedType
.Name);
1473
Assert.Equal("Int32", typeInfo.
ConvertedType
.Name);
1521
Assert.Equal("Int32", typeInfo.
ConvertedType
.Name);
1569
Assert.Equal("E", typeInfo.
ConvertedType
.Name);
1609
Assert.Equal("Int32", typeInfo.
ConvertedType
.Name);
1694
Assert.Equal("Object", typeInfo.
ConvertedType
.Name);
2278
Assert.Equal("System.Int32*", typeInfo.
ConvertedType
.ToTestDisplayString());
2279
Assert.Equal(TypeKind.Pointer, typeInfo.
ConvertedType
.TypeKind);
3167
Assert.Equal(TypeKind.Error, info.
ConvertedType
.TypeKind);
3202
Assert.Equal(SpecialType.System_Int64, info.
ConvertedType
.SpecialType);
3759
Assert.Equal(stringType, identifierInfo.
ConvertedType
);
3787
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: false));
3794
Assert.Equal("C", typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: false));
4497
Assert.NotNull(typeInfo.
ConvertedType
);
4498
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4561
Assert.NotNull(typeInfo.
ConvertedType
);
4562
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
4575
Assert.NotNull(typeInfo.
ConvertedType
);
4576
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
Compilation\SemanticModelGetSemanticInfoTests.cs (6)
14807
Assert.Null(typeInfo.
ConvertedType
);
14823
Assert.Equal("Test.C", typeInfo.
ConvertedType
.ToTestDisplayString());
14903
Assert.Null(typeInfo.
ConvertedType
);
14919
Assert.Equal("Test.I", typeInfo.
ConvertedType
.ToTestDisplayString());
15014
Assert.Null(typeInfo.
ConvertedType
);
15029
Assert.Equal("Test.I", typeInfo.
ConvertedType
.ToTestDisplayString());
Symbols\CovariantReturnTests.cs (4)
386
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
2633
Assert.Equal("System.Linq.Expressions.Expression(Of System.Func(Of Derived, String))", typeInfo.
ConvertedType
.ToDisplayString());
2637
Assert.Equal("System.Linq.Expressions.Expression(Of System.Func(Of Derived, System.Func(Of String)))", typeInfo.
ConvertedType
.ToDisplayString());
2640
Assert.Equal(typeInfo.Type, typeInfo.
ConvertedType
);
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1744
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString());
Symbols\Source\BaseClassTests.cs (1)
2034
Assert.Equal(SpecialType.System_Int64, typeInfo.
ConvertedType
.SpecialType);
Symbols\Source\EventTests.cs (2)
439
Assert.Equal("System.Action<dynamic>", lambdaTypeInfo.
ConvertedType
.ToTestDisplayString());
485
Assert.Equal("System.Action<dynamic>", lambdaTypeInfo.
ConvertedType
.ToTestDisplayString());
Symbols\Source\NullablePublicAPITests.cs (11)
3699
Assert.Equal("System.String!", typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: true));
3706
Assert.Equal("C!", typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: true));
3734
Assert.Equal("System.String!", typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: true));
3741
Assert.Equal("C!", typeInfo.
ConvertedType
.ToTestDisplayString(includeNonNullable: true));
5257
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
5280
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
5312
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
5335
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
5357
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
5405
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
5462
var type = (IArrayTypeSymbol)typeInfo.
ConvertedType
;
Symbols\StaticAbstractMembersInInterfacesTests.cs (5)
19563
Assert.Equal("I1", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
19646
Assert.Equal("System.Boolean", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
19738
Assert.Equal("I1", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
19827
Assert.Equal("C", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
28776
Assert.Equal("C", model.GetTypeInfo(node).
ConvertedType
.ToTestDisplayString());
Symbols\TypeTests.cs (3)
1784
Assert.True(((ITypeSymbol)tinfo.
ConvertedType
).IsNullableType());
1785
Assert.Same(comp.GetSpecialType(SpecialType.System_Decimal), ((ITypeSymbol)tinfo.
ConvertedType
).GetNullableUnderlyingType());
1786
Assert.Equal("decimal?", tinfo.
ConvertedType
.ToDisplayString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (9)
CompilationTestUtils.cs (9)
239
summary.ConvertedType = typeInfo.
ConvertedType
;
250
summary.ConvertedType = typeInfo.
ConvertedType
;
267
summary.ConvertedType = typeInfo.
ConvertedType
;
276
summary.ConvertedType = typeInfo.
ConvertedType
;
313
summary.ConvertedType = typeInfo.
ConvertedType
;
381
if (typeInfo.
ConvertedType
is null)
387
Assert.Equal(typeInfo.
ConvertedType
.NullableAnnotation, iop.Type.NullableAnnotation);
428
Assert.True(iop.Type?.NullableAnnotation == typeInfo.
ConvertedType
?.NullableAnnotation);
477
(annotation.IsConverted ? typeInfo.
ConvertedType
: typeInfo.Type).GetSymbol(),
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
Simplification\CSharpSimplificationService.Expander.cs (1)
271
var argumentType = _semanticModel.GetTypeInfo(node.Expression).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
387
if (expressionTypes.
ConvertedType
.IsSpan() &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
797
if (expressionType.Equals(typeInfo.
ConvertedType
?.OriginalDefinition))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
307
var originalConvertedType = originalSemanticModel.GetTypeInfo(castNode.WalkUpParentheses(), cancellationToken).
ConvertedType
;
837
if (!originalConditionalTypeInfo.
ConvertedType
!.Equals(rewrittenConditionalTypeInfo.
ConvertedType
, SymbolEqualityComparer.IncludeNullability))
861
=> IsNullOrErrorType(info.Type) || IsNullOrErrorType(info.
ConvertedType
);
1468
var rewrittenConvertedType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (6)
399
newExpressionType = newExpressionTypeInfo.
ConvertedType
;
547
var originalConvertedTypeConversion = this.OriginalSemanticModel.ClassifyConversion(previousOriginalNode, originalExpressionTypeInfo.
ConvertedType
);
548
var newExpressionConvertedTypeConversion = this.SpeculativeSemanticModel.ClassifyConversion(previousReplacedNode, newExpressionTypeInfo.
ConvertedType
);
758
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.
ConvertedType
))
785
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.
ConvertedType
))
804
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.
ConvertedType
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1432
var type = this.SemanticModel.GetTypeInfo(recursivePattern).
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (1)
10
=> typeInfo.
ConvertedType
?.WithNullableAnnotation(typeInfo.ConvertedNullability.Annotation);
Microsoft.CodeAnalysis.Features (16)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
109
var convertedType = (ISymbol?)state.SemanticModel.GetTypeInfo(node, cancellationToken).
ConvertedType
;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
294
var convertedType = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).
ConvertedType
;
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
347
var typeSymbol = semanticModel.GetTypeInfo(_expression, cancellationToken).
ConvertedType
?? semanticModel.Compilation.ObjectType;
IntroduceVariable\AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs (1)
114
return typeInfo.Type ?? typeInfo.
ConvertedType
?? semanticModel.Compilation.GetSpecialType(SpecialType.System_Object);
IntroduceVariable\AbstractIntroduceVariableService.cs (4)
413
typeInfo.
ConvertedType
?.IsFormattableStringOrIFormattable() == true)
415
return typeInfo.
ConvertedType
;
423
if (typeInfo.
ConvertedType
!= null)
425
return typeInfo.
ConvertedType
;
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
225
return typeInfo.
ConvertedType
?.IsFormattableStringOrIFormattable() != true;
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
59
if (semanticModel.GetTypeInfo(tuple, cancellationToken).
ConvertedType
is not INamedTypeSymbol tupleType)
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
156
typeInfo.
ConvertedType
?.SpecialType == SpecialType.System_Boolean;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (1)
169
if (typeInfo.Type is IDynamicTypeSymbol || typeInfo.
ConvertedType
is IDynamicTypeSymbol)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
252
var convertedType = this.SemanticModel.GetTypeInfo(SyntaxFacts.GetExpressionOfArgument(arguments[0]), cancellationToken).
ConvertedType
;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
204
return semanticModel.GetTypeInfo(expression).
ConvertedType
;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
482
if (argumentTypeInfo.Type == null && argumentTypeInfo.
ConvertedType
== null)
538
if (parameterType.Equals(argumentTypeInfo.Type) || parameterType.Equals(argumentTypeInfo.
ConvertedType
))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (6)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (1)
56
If symbolInfo.Type IsNot Nothing AndAlso symbolInfo.Type.Equals(symbolInfo.
ConvertedType
, SymbolEqualityComparer.Default) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
1077
If expressionTypeOpt.Equals(typeInfo.
ConvertedType
?.OriginalDefinition) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (4)
69
If Not Object.Equals(expressionTypeInfo.Type, expressionTypeInfo.
ConvertedType
) Then
70
Return expressionTypeInfo.
ConvertedType
119
Return expressionTypeInfo.
ConvertedType
210
castExpressionType = _semanticModel.GetSpeculativeTypeInfo(_castExpressionNode.SpanStart, _castExpressionNode, SpeculativeBindingOption.BindAsExpression).
ConvertedType
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (3)
34
If info.
ConvertedType
IsNot Nothing AndAlso info.
ConvertedType
.TypeKind <> TypeKind.Error Then
35
Return CreateResult(info.
ConvertedType
)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (7)
CodeGen\CodeGenTuples.vb (7)
11779
Assert.Equal("System.Nullable(Of (a As System.Int16, b As System.String))", typeInfo.
ConvertedType
.ToTestDisplayString())
11786
Assert.Equal("System.Int16", typeInfo.
ConvertedType
.ToTestDisplayString())
11793
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
11898
Assert.Equal("System.Nullable(Of (a As System.Int16, b As System.String))", typeInfo.
ConvertedType
.ToTestDisplayString())
11928
Assert.Equal("System.Nullable(Of (a As System.Int16, b As System.String))", typeInfo.
ConvertedType
.ToTestDisplayString())
11935
Assert.Equal("System.Int16", typeInfo.
ConvertedType
.ToTestDisplayString())
11942
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
Microsoft.CodeAnalysis.VisualBasic.Features (17)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
698
Dim convertedType As ISymbol = semanticModel.GetTypeInfo(u, cancellationToken).
ConvertedType
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (2)
46
Return If(info.
ConvertedType
.IsObjectType(), info.
ConvertedType
, info.Type)
ExtractMethod\VisualBasicSelectionResult.vb (13)
192
Return If(info.Type.IsObjectType(), info.
ConvertedType
, info.Type)
203
If info.
ConvertedType
IsNot Nothing AndAlso
204
Not info.
ConvertedType
.IsErrorType() Then
206
Return info.
ConvertedType
209
Dim conversion = semanticModel.ClassifyConversion(expression, info.
ConvertedType
)
211
Return info.
ConvertedType
216
Return info.
ConvertedType
222
info.
ConvertedType
?.IsFormattableStringOrIFormattable() Then
224
Return info.
ConvertedType
228
Return If(info.Type.IsObjectType(), info.
ConvertedType
, info.Type)
233
info.
ConvertedType
Is Nothing OrElse
234
info.
ConvertedType
.TypeKind <> TypeKind.Interface Then
239
Return info.
ConvertedType
.GetAttributes().Any(Function(c) c.AttributeClass.Equals(coclassSymbol))
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (1)
56
If symbolInfo.Type IsNot Nothing AndAlso symbolInfo.Type.Equals(symbolInfo.
ConvertedType
, SymbolEqualityComparer.Default) Then
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (109)
Compilation\SemanticModelAPITests.vb (2)
674
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString())
727
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\CompoundAssignment.vb (5)
301
Assert.Equal("System.Double", typeInfo.
ConvertedType
.ToTestDisplayString())
314
Assert.Equal("System.Double", typeInfo.
ConvertedType
.ToTestDisplayString())
1028
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1042
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1056
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\ConditionalAccessTests.vb (24)
648
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString())
660
Assert.Equal("System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString())
670
Assert.Equal("System.Nullable(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
681
Assert.Equal("System.Nullable(Of S1)", typeInfo.
ConvertedType
.ToTestDisplayString())
1328
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1338
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1349
Assert.Equal("System.Func(Of System.Int32, System.String)", typeInfo.
ConvertedType
.ToTestDisplayString())
1362
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1373
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1384
Assert.Equal("System.String()", typeInfo.
ConvertedType
.ToTestDisplayString())
1397
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1407
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1418
Assert.Equal("C1", typeInfo.
ConvertedType
.ToTestDisplayString())
1507
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1516
Assert.Equal("System.String", typeInfo.
ConvertedType
.ToTestDisplayString())
1527
Assert.Equal("System.Xml.Linq.XElement", typeInfo.
ConvertedType
.ToTestDisplayString())
1538
Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.
ConvertedType
.ToTestDisplayString())
1550
Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.
ConvertedType
.ToTestDisplayString())
1559
Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.
ConvertedType
.ToTestDisplayString())
1570
Assert.Equal("System.Xml.Linq.XElement", typeInfo.
ConvertedType
.ToTestDisplayString())
1581
Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.
ConvertedType
.ToTestDisplayString())
1593
Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.
ConvertedType
.ToTestDisplayString())
1602
Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.
ConvertedType
.ToTestDisplayString())
1613
Assert.Equal("System.Xml.Linq.XElement", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\Conversions_AnonymousDelegates.vb (27)
52
Assert.Equal("System.Action(Of System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.
ConvertedType
.ToTestDisplayString())
143
Assert.Equal("Sub <generated method>(x As System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.
ConvertedType
.ToTestDisplayString())
200
Assert.Equal("Sub <generated method>(x As System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.
ConvertedType
.ToTestDisplayString())
285
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
366
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
390
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
434
Assert.Equal("System.Action(Of System.Object)", typeInfo.
ConvertedType
.ToTestDisplayString())
515
Assert.Equal("System.Action(Of System.Object)", typeInfo.
ConvertedType
.ToTestDisplayString())
545
Assert.Equal("System.Action(Of System.Object)", typeInfo.
ConvertedType
.ToTestDisplayString())
952
Assert.Equal("System.Action(Of System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.
ConvertedType
.ToTestDisplayString())
1038
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1091
Assert.Equal("System.Action", typeInfo.
ConvertedType
.ToTestDisplayString())
1193
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1241
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1320
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1351
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1403
Assert.Equal("System.Func(Of System.Object)", typeInfo.
ConvertedType
.ToTestDisplayString())
1508
Assert.Equal("System.Func(Of System.Collections.IEnumerable)", typeInfo.
ConvertedType
.ToTestDisplayString())
1594
Assert.Equal("System.Func(Of System.Guid)", typeInfo.
ConvertedType
.ToTestDisplayString())
1641
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1719
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1742
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1790
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1838
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1893
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
1990
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
2021
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\GetExtendedSemanticInfoTests.vb (10)
9057
Assert.Null(typeInfo.
ConvertedType
)
9077
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString())
9121
Assert.Null(typeInfo.
ConvertedType
)
9138
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString())
9185
Assert.Null(typeInfo.
ConvertedType
)
9203
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString())
9250
Assert.Null(typeInfo.
ConvertedType
)
9270
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString())
9311
Assert.Null(typeInfo.
ConvertedType
)
9328
Assert.Equal("System.Object", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\GetSemanticInfoTests.vb (6)
5358
Assert.Null(typeInfo.
ConvertedType
)
5374
Assert.Equal("Test.C", typeInfo.
ConvertedType
.ToTestDisplayString())
5447
Assert.Null(typeInfo.
ConvertedType
)
5463
Assert.Equal("Test.I", typeInfo.
ConvertedType
.ToTestDisplayString())
5552
Assert.Null(typeInfo.
ConvertedType
)
5567
Assert.Equal("Test.I", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\Lambda_AnonymousDelegateInference.vb (3)
444
Assert.Equal("Sub <generated method>(x As System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
456
Assert.Equal("Sub <generated method>(x As System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
468
Assert.Equal("Function <generated method>() As System.Int32", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\Lambda_Relaxation.vb (31)
45
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
161
Assert.Null(typeInfo.
ConvertedType
)
259
Assert.Null(typeInfo.
ConvertedType
)
357
Assert.Null(typeInfo.
ConvertedType
)
452
Assert.Equal("System.Action(Of System.Object)", typeInfo.
ConvertedType
.ToTestDisplayString())
858
Assert.Equal("System.Action(Of System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.
ConvertedType
.ToTestDisplayString())
933
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
978
Assert.Equal("System.Action(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1033
Assert.Equal("System.Action", typeInfo.
ConvertedType
.ToTestDisplayString())
1188
Assert.Equal("System.Action", typeInfo.
ConvertedType
.ToTestDisplayString())
1250
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1301
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1313
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1414
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1426
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1459
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1471
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1525
Assert.Equal("System.Func(Of System.Object)", typeInfo.
ConvertedType
.ToTestDisplayString())
1624
Assert.Equal("System.Func(Of System.Collections.IEnumerable)", typeInfo.
ConvertedType
.ToTestDisplayString())
1701
Assert.Equal("System.Func(Of System.Guid)", typeInfo.
ConvertedType
.ToTestDisplayString())
1755
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1767
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1915
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1927
Assert.Equal("System.Func(Of System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1939
Assert.Equal("System.Func(Of System.Int32, System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
1951
Assert.Equal("System.Func(Of System.Int32, System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
2007
Assert.Equal("System.Func(Of System.Int32, System.Int32)", typeInfo.
ConvertedType
.ToTestDisplayString())
2060
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
2152
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
2180
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
2235
Assert.Equal("d1", typeInfo.
ConvertedType
.ToTestDisplayString())
Semantics\Parenthesized.vb (1)
248
Assert.Equal("Program.DT1", typeInfo.
ConvertedType
.ToTestDisplayString())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (11)
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
94
initializerType = semanticModel.GetSpeculativeTypeInfo(variableDeclarator.Initializer.Value.SpanStart, variableDeclarator.Initializer.Value, SpeculativeBindingOption.BindAsExpression).
ConvertedType
Simplification\VisualBasicSimplificationService.Expander.vb (2)
90
If typeInfo.
ConvertedType
IsNot Nothing Then
91
result = AddCast(result, typeInfo.
ConvertedType
, oldExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
1077
If expressionTypeOpt.Equals(typeInfo.
ConvertedType
?.OriginalDefinition) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (4)
69
If Not Object.Equals(expressionTypeInfo.Type, expressionTypeInfo.
ConvertedType
) Then
70
Return expressionTypeInfo.
ConvertedType
119
Return expressionTypeInfo.
ConvertedType
210
castExpressionType = _semanticModel.GetSpeculativeTypeInfo(_castExpressionNode.SpanStart, _castExpressionNode, SpeculativeBindingOption.BindAsExpression).
ConvertedType
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (3)
34
If info.
ConvertedType
IsNot Nothing AndAlso info.
ConvertedType
.TypeKind <> TypeKind.Error Then
35
Return CreateResult(info.
ConvertedType
)
Microsoft.CodeAnalysis.Workspaces (14)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
109
var convertedType = semanticModel.GetTypeInfo(lambdaNode, cancellationToken).
ConvertedType
;
149
var convertedType2 = semanticModel.GetTypeInfo(lambdaNode, cancellationToken).
ConvertedType
;
Shared\Extensions\SemanticModelExtensions.cs (1)
111
convertedType = typeInfo.
ConvertedType
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (5)
36
if (innerTypeInfo.Type != null && innerTypeInfo.
ConvertedType
!= null)
38
if (!innerTypeInfo.Type.Equals(innerTypeInfo.
ConvertedType
))
57
if (!Equals(semanticModel.GetTypeInfo(parentBinaryLeft).
ConvertedType
,
58
semanticModel.GetTypeInfo(parentBinaryRight).
ConvertedType
))
116
=> IsFloatingPoint(typeInfo.Type) || IsFloatingPoint(typeInfo.
ConvertedType
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (6)
291
return SymbolsAreCompatible(originalTypeInfo.
ConvertedType
, newTypeInfo.
ConvertedType
);
826
var expressionType = this.SpeculativeSemanticModel.GetTypeInfo(newForEachStatementExpression, CancellationToken).
ConvertedType
;
1001
? speculativeSemanticModel.GetTypeInfo(newReceiver).
ConvertedType
1216
var originalConvertedTypeSymbol = this.OriginalSemanticModel.GetTypeInfo(originalExpression).
ConvertedType
;
1222
var newConvertedTypeSymbol = this.SpeculativeSemanticModel.GetTypeInfo(newExpression).
ConvertedType
;