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