1 write to Type
Microsoft.CodeAnalysis (1)
Compilation\TypeInfo.cs (1)
45this.Type = type;
2621 references to Type
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
404var type = e.SemanticModel?.GetTypeInfo(e.Syntax).Type!;
Microsoft.AspNetCore.App.Analyzers (1)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
206return typeInfo?.Type as INamedTypeSymbol;
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
206return typeInfo?.Type as INamedTypeSymbol;
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
206return typeInfo?.Type as INamedTypeSymbol;
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (1)
HubClientProxyGenerator.Parser.cs (1)
262symbol = argTypeInfo.Type;
Microsoft.CodeAnalysis (3)
Compilation\TypeInfo.cs (3)
53return object.Equals(this.Type, other.Type) 67Hash.Combine(this.Type,
Microsoft.CodeAnalysis.CodeStyle (42)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
74var collectionType = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfForeachStatement(node), cancellationToken).Type;
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
155typeInfo.Type?.SpecialType == SpecialType.System_Boolean &&
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
168return invocation.SemanticModel?.GetTypeInfo(expression).Type as INamedTypeSymbol;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
166var exprType = semanticModel.GetTypeInfo(initializer, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
115if (!nullableType.Equals(type.Type?.OriginalDefinition))
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
105conditionLeftIsNull ? conditionRightLow : conditionLeftLow, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (1)
169if (typeInfo.Type is IDynamicTypeSymbol || typeInfo.ConvertedType is IDynamicTypeSymbol)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
187var type = this.SemanticModel.GetTypeInfo(_objectCreationExpression, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
144if (objectType.Type == null || !objectType.Type.AllInterfaces.Contains(ienumerableType))
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
154var parameterType = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
147var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type; 151var type = semanticModel.GetTypeInfo(conditionalExpression, cancellationToken).Type; 359var typeSymbol = semanticModel.GetTypeInfo(type, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (2)
85var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type; 89var whenPartIsNullable = semanticModel.GetTypeInfo(whenPartMatch).Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
122var type = this.SemanticModel.GetTypeInfo(_objectCreationExpression, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
238if (typeInfo.Type != null) 240return typeInfo.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (6)
36if (innerTypeInfo.Type != null && innerTypeInfo.ConvertedType != null) 38if (!innerTypeInfo.Type.Equals(innerTypeInfo.ConvertedType)) 43if (innerTypeInfo.Type is IDynamicTypeSymbol) 51if (!Equals(semanticModel.GetTypeInfo(parentBinaryLeft).Type, 52semanticModel.GetTypeInfo(parentBinaryRight).Type)) 116=> IsFloatingPoint(typeInfo.Type) || IsFloatingPoint(typeInfo.ConvertedType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (17)
245if (originalTypeInfo.Type == null) 251if (newTypeInfo.Type == null) 267if (SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.Type)) 273if (originalTypeInfo.Type != null && newTypeInfo.Type == null && 636if (newTypeInfo.Type.IsErrorType() && !originalTypeInfo.Type.IsErrorType()) 740var previousOriginalType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode).Type; 741var previousReplacedType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode).Type; 849var originalThrowExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalThrowExpression).Type; 851var newThrowExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(newThrowExpression).Type; 964var originalTargetType = this.OriginalSemanticModel.GetTypeInfo(originalLeft).Type; 967var newTargetType = this.SpeculativeSemanticModel.GetTypeInfo(newLeft).Type; 1039var receiverType = semanticModel.GetTypeInfo(receiver).Type; 1208if (this.OriginalSemanticModel.GetTypeInfo(originalExpression).Type != null && 1209this.SpeculativeSemanticModel.GetTypeInfo(newExpression).Type != null)
Microsoft.CodeAnalysis.CodeStyle.Fixes (15)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
143var castType = semanticModel.GetTypeInfo(castTypeNode, cancellationToken).Type;
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
169&& semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type is ITypeSymbol argumentType
src\Analyzers\Core\CodeFixes\AddExplicitCast\InheritanceDistanceComparer.cs (1)
49var baseType = _semanticModel.GetTypeInfo(x.syntax).Type;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (4)
482if (argumentTypeInfo.Type == null && argumentTypeInfo.ConvertedType == null) 538if (parameterType.Equals(argumentTypeInfo.Type) || parameterType.Equals(argumentTypeInfo.ConvertedType)) 559if (argumentTypeInfo.Type != null) 561var conversion = compilation.ClassifyCommonConversion(argumentTypeInfo.Type, parameterType);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (7)
128if (typeInfo.Type is IPointerTypeSymbol pointerType) 146typeToGenerateIn = attributeType.Type as INamedTypeSymbol; 154typeToGenerateIn = semanticModel.GetTypeInfo(initializedObject, cancellationToken).Type as INamedTypeSymbol; 189typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter 191: typeInfo.Type as INamedTypeSymbol; 194isColorColorCase = typeInfo.Type != null && semanticInfo.Symbol != null && semanticInfo.Symbol.Name == typeInfo.Type.Name;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
602var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (2)
256queryBody.SelectOrGroup.Span.End - 1, identifierName, SpeculativeBindingOption.BindAsExpression).Type; 262type = SemanticModelOpt.GetTypeInfo(identifier).Type;
Microsoft.CodeAnalysis.CSharp.CodeStyle (78)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
92if (syntaxContext.SemanticModel.GetTypeInfo(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (5)
183var expressionType = semanticModel.GetTypeInfo(memberAccess.Expression, cancellationToken).Type; 250var argumentType = semanticModel.GetTypeInfo(objectCreation.ArgumentList.Arguments[0].Expression, cancellationToken).Type; 339var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 350var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 433var type = state.SemanticModel.GetTypeInfo(memberAccess.Expression, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (7)
93if (originalTypeInfo.Type is IErrorTypeSymbol) 110if (originalTypeInfo.Type != null && 111!originalTypeInfo.Type.Equals(originalTypeInfo.ConvertedType) && 126return IsConstructibleCollectionType(compilation, semanticModel.GetTypeInfo(parent, cancellationToken).Type); 172var type = originalTypeInfo.Type; 598semanticModel.GetTypeInfo(expression, cancellationToken).Type?.IsValueType == true; 626=> semanticModel.GetTypeInfo(expression, cancellationToken).Type is not null and not IErrorTypeSymbol;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
164if (semanticModel.GetTypeInfo(testedExpression, cancellationToken).Type is IPointerTypeSymbol or IFunctionPointerTypeSymbol)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
167var type = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
145var leftType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type; 146var rightType = semanticModel.GetTypeInfo(objectCreation, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
76if (semanticModel.GetTypeInfo(castExpression.Type).Type?.SpecialType == SpecialType.System_Object) 78var expressionType = semanticModel.GetTypeInfo(castExpression.Expression).Type;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
90var castType = semanticModel.GetTypeInfo(castExpression.Type).Type; 130var asType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type; 254if (rightType.Type is null or { NullableAnnotation: NullableAnnotation.Annotated })
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
113var isType = semanticModel.GetTypeInfo(castExpression.Type).Type;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
83=> semanticModel.GetTypeInfo(type, cancellationToken).Type.IsNullable()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
127var containingType = semanticModel.GetTypeInfo(containingTypeName, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
52var entityType = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type; 53var defaultType = semanticModel.GetTypeInfo(defaultExpression.Type, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
388expressionTypes.Type.IsInlineArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
76if (semanticModel.GetTypeInfo(varDecl.Type, cancellationToken).Type.IsSpanOrReadOnlySpan()) 313var potentialType = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (4)
115if (typeInfo.Type != null) 117symbol = typeInfo.Type; 417if (info.Type == null) 422return semanticModel.GenerateNameFromType(info.Type, CSharpSyntaxFacts.Instance, capitalize);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
38var type = semanticModel.GetTypeInfo(typeSyntax).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
366var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (18)
120var enumType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol; 121var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 155var enumType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol; 156var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 160var parentCastType = semanticModel.GetTypeInfo(parentCast.Type, cancellationToken).Type; 486var castedExpressionType = originalSemanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 487var isType = originalSemanticModel.GetTypeInfo(isExpression.Right, cancellationToken).Type; 574var castedType = originalSemanticModel.GetTypeInfo(castNode, cancellationToken).Type; 649var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 840var castType = originalSemanticModel.GetTypeInfo(castExpression, cancellationToken).Type; 861=> IsNullOrErrorType(info.Type) || IsNullOrErrorType(info.ConvertedType); 986var castSideType = semanticModel.GetTypeInfo(castSide, cancellationToken).Type; 987var castedExpressionType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type; 991var otherSideType = semanticModel.GetTypeInfo(otherSide, cancellationToken).Type; 1009var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 1010var castedExpressionType = semanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 1051return typeInfo.Type?.Kind == SymbolKind.ArrayType; 1237var rewrittenType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (15)
386var originalExpressionType = originalExpressionTypeInfo.Type; 387var newExpressionType = newExpressionTypeInfo.Type; 435var originalCaseType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode, this.CancellationToken).Type; 436var newCaseType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode, this.CancellationToken).Type; 494if (!Equals(originalExprType.Type, replacedExprType.Type)) 545if (!Equals(originalExpressionTypeInfo.Type, newExpressionTypeInfo.Type)) 561var originalExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 562var newExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(replacedAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 702var originalConvertedType = this.OriginalSemanticModel.GetTypeInfo(originalIsOrAsExpression.Right).Type; 703var newConvertedType = this.SpeculativeSemanticModel.GetTypeInfo(newIsOrAsExpression.Right).Type; 758SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType)) 785SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType)) 804SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
79var declaredTypeSymbol = semanticModel.GetTypeInfo(variableDeclaration.Type.StripRefIfNeeded(), cancellationToken).Type; 97? IsMadeOfSpecialTypes(semanticModel.GetTypeInfo(typeSyntax.StripRefIfNeeded()).Type) 137semanticModel.GetTypeInfo(typeSyntax).Type?.IsSpecialType() == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
149var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type; 157return !initializerTypeInfo.Type.IsErrorType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (4)
195var declarationType = semanticModel.GetTypeInfo(declarationTypeNode, cancellationToken).Type; 205var newDeclarationType = newSemanticModel.GetTypeInfo(newDeclarationTypeNode, cancellationToken).Type; 293var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type; 332var initializerType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (40)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (2)
97var leftType = semanticModel.GetTypeInfo(assignmentExpression.Left).Type; 98var rightType = semanticModel.GetTypeInfo(assignmentExpression.Right).Type;
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (3)
194typeInfo.Type is not null && 195!Equals(typeInfo.ConvertedType, typeInfo.Type)) 197var conversion = _semanticModel.Compilation.ClassifyConversion(typeInfo.Type, typeInfo.ConvertedType);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
286=> iEquatable.Equals(semanticModel.GetTypeInfo(baseItem.Type, cancellationToken).Type));
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (3)
76var returnedType = semanticModel.GetTypeInfo(returnedValue, cancellationToken).Type; 91var previousReturnType = semanticModel.GetTypeInfo(declarationTypeToFix, cancellationToken).Type; 168var type = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
161if (typeInfo.Type is INamedTypeSymbol typeSymbol)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
78type = model.GetTypeInfo(assignment.Right).Type; 83type = model.GetTypeInfo(deconstruction.Parent).Type;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (3)
143typeToGenerateIn = document.SemanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type as INamedTypeSymbol; 145|| document.SemanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type is not INamedTypeSymbol parameterSymbol 176|| document.SemanticModel.GetTypeInfo(expression, cancellationToken).Type is not INamedTypeSymbol parameterSymbol
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (2)
55type: semanticModel.GetTypeInfo(((ConstantPatternSyntax)positionalPattern.Subpatterns[i].Pattern).Expression, cancellationToken).Type ?? semanticModel.Compilation.GetSpecialType(SpecialType.System_Object), 60var targetType = semanticModel.GetTypeInfo(target, cancellationToken: cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
67typeToGenerateIn = semanticInfo.Type as INamedTypeSymbol;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
121if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter) 159result.Add(typeInfo.Type);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
97returnExpressionType = info.Type;
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
126semanticModel.GetTypeInfo(implicitObjectCreation).Type is { } type)
src\Analyzers\CSharp\CodeFixes\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (3)
27var leftPartTypeSymbol = semanticModel.GetTypeInfo(expressionToCoalesce, cancellationToken).Type; 28var rightPartTypeSymbol = semanticModel.GetTypeInfo(rightAssignmentPart, cancellationToken).Type; 29var finalDestinationTypeSymbol = semanticModel.GetTypeInfo(leftAssignmentPart, cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
97var type = semanticModel.GetTypeInfo(coalesce, cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
113var type = semanticModel.GetTypeInfo(expr).Type; 127var governingType = semanticModel.GetTypeInfo(p.Target.Syntax).Type.RemoveNullableIfPresent();
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
141if (asExpressionTypeInfo.Type != null) 145var asType = asExpressionTypeInfo.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
694return typeInfo.Type.IsNumericType();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
123SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 180name.SpanStart, name, SpeculativeBindingOption.BindAsExpression).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (4)
29return typeInfo.Type?.IsErrorType() == false ? typeInfo.Type : semanticModel.Compilation.ObjectType; 36if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
63return Equals(localSymbol.Type, rightType.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
141var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (1)
13=> typeInfo.Type?.WithNullableAnnotation(typeInfo.Nullability.Annotation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
CodeGeneration\SyntaxGeneratorTests.cs (1)
91Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType);
SymbolKey\SymbolKeyTestBase.cs (5)
57ResolveAndVerifySymbol(typeinfo.Type ?? typeinfo.ConvertedType, sourceSymbol, sourceComp); 408else if (tinfo.Type != null && tinfo.Type.TypeKind != TypeKind.Delegate) 412list.Add(tinfo.Type); // NamedType with empty name 413foreach (var m in tinfo.Type.GetMembers())
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (255)
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (4)
897Assert.Null(firstLambda.Type); 901Assert.Null(secondLambda.Type); 949Assert.Null(firstLambda.Type); 953Assert.Null(secondLambda.Type);
CodeGen\CodeGenDeconstructTests.cs (64)
98Assert.Equal("(System.Int64 x, System.String y)", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 103Assert.Equal("C", model.GetTypeInfo(right).Type.ToTestDisplayString()); 1471var tuple1 = model.GetTypeInfo(xy).Type; 1475var tuple2 = model.GetTypeInfo(ab).Type; 1512var tupleType1 = model.GetTypeInfo(tuple1).Type; 1517var tupleType2 = model.GetTypeInfo(tuple1).Type; 1565var tupleType = model.GetTypeInfo(tuple).Type; 2690Assert.Equal("(System.Int64 x, (System.String y, System.String z))", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3132Assert.Equal("(System.Int32 x1, (System.Int32 x2, System.String x3))", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3137Assert.Null(model.GetTypeInfo(lhsNested).Type); 3181model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3186Assert.Equal("(System.Int32 x2, (System.Int32 x3, System.String x4))", model.GetTypeInfo(x234).Type.ToTestDisplayString()); 3191Assert.Null(model.GetTypeInfo(x34).Type); 3245model.GetTypeInfo(x123).Type.ToTestDisplayString()); 3250Assert.Equal("(System.Int32 x2, System.Int32 x3)", model.GetTypeInfo(x23).Type.ToTestDisplayString()); 3282Assert.Equal("(System.Int32 x1, (System.Int32 x2, System.String x3))", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3288Assert.Equal("(System.Int32 x2, System.String x3)", model.GetTypeInfo(lhsNested).Type.ToTestDisplayString()); 3332Assert.Equal("(System.Int32 x1, System.Byte, (System.Int32 x2, System.String x3))", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3338Assert.Equal("(System.Int32 x2, System.String x3)", model.GetTypeInfo(lhsNested).Type.ToTestDisplayString()); 3445Assert.Equal("(System.String x1, System.Byte x2, System.Int32 x3)", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3449Assert.Null(model.GetTypeInfo(literal).Type); 3481Assert.Equal("(System.String x1, (System.Int32, System.Int32) x2)", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 3485Assert.Null(model.GetTypeInfo(literal).Type); 3491Assert.Equal("(System.Int32, System.Int32)", model.GetTypeInfo(nestedLiteral).Type.ToTestDisplayString()); 3605Assert.Equal(local.Type.GetPublicSymbol(), model.GetTypeInfo(reference).Type); 3624Assert.Equal(field.Type, model.GetTypeInfo(reference).Type); 4038Assert.Equal("(System.Int32 x1, System.Int32 x2)", model.GetTypeInfo(x12Var).Type.ToTestDisplayString()); 5741Assert.Equal("System.Byte", model.GetTypeInfo(x123Var.Type).Type.ToTestDisplayString()); 5783Assert.Equal("Script.var", model.GetTypeInfo(x123Var.Type).Type.ToTestDisplayString()); 5913Assert.Equal("System.Int32", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 5921Assert.Equal("C", model.GetTypeInfo(declaration2).Type.ToTestDisplayString()); 5927Assert.Equal("(C, System.Int32 z)", model.GetTypeInfo(declaration3).Type.ToTestDisplayString()); 6002Assert.Equal("System.Int32", model.GetTypeInfo(discard).Type.ToTestDisplayString()); 6258Assert.Equal("System.Int32", model.GetTypeInfo(discard).Type.ToTestDisplayString()); 6311Assert.Equal("(System.Int64, System.Int32 x)", model.GetTypeInfo(tuple1).Type.ToTestDisplayString()); 6341Assert.Equal("(System.Int32, System.Int32 x)", model.GetTypeInfo(tuple1).Type.ToTestDisplayString()); 6396Assert.Null(model.GetTypeInfo(discard1).Type); 6400Assert.Null(model.GetTypeInfo(discard1).Type); 6401Assert.Equal("(System.Int32, System.String x)", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 6406Assert.Equal("System.Int32", model.GetTypeInfo(discard2).Type.ToTestDisplayString()); 6410Assert.Equal("(System.String y, System.Int32 z)", model.GetTypeInfo(yz).Type.ToTestDisplayString()); 6415Assert.Equal("System.String", model.GetTypeInfo(y).Type.ToTestDisplayString()); 6446Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(tuple).Type.ToTestDisplayString()); 6564Assert.Equal("System.Int32", model.GetTypeInfo(discard1).Type.ToTestDisplayString()); 6874Assert.Equal("(System.String, System.Int32)", model.GetTypeInfo(tuple).Type.ToTestDisplayString()); 6937Assert.Equal("(System.Int32, System.Int32 x3)", model.GetTypeInfo(nestedDeclaration).Type.ToTestDisplayString()); 6942Assert.Equal("(System.String, (System.Int32, System.Int32 x3))", model.GetTypeInfo(tuple).Type.ToTestDisplayString()); 6978Assert.Null(model.GetTypeInfo(discard1).Type); 6981Assert.Equal("System.Int64", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 6987Assert.Null(model.GetTypeInfo(discard2).Type); 6990Assert.Equal("System.Int32", model.GetTypeInfo(declaration2).Type.ToTestDisplayString()); 6996Assert.Equal("System.Int32", model.GetTypeInfo(discard3).Type.ToTestDisplayString()); 7000Assert.Equal("System.Int32", model.GetTypeInfo(discard3).Type.ToTestDisplayString()); 7005Assert.Null(model.GetTypeInfo(discard4).Type); 7009Assert.Equal("(System.String, System.Int32)", model.GetTypeInfo(nestedDeclaration).Type.ToTestDisplayString()); 7240Assert.Equal("(System.Int32 x1, System.Int32 z)", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 7356Assert.Equal("int", model.GetTypeInfo(x1Ref).Type.ToDisplayString()); 7361Assert.Equal("string[]", model.GetTypeInfo(x2Ref).Type.ToDisplayString()); 7395Assert.Equal("int", model.GetTypeInfo(x1Ref).Type.ToDisplayString()); 7431Assert.Equal("int", model.GetTypeInfo(x1Ref.First()).Type.ToDisplayString()); 7436Assert.Equal("string[]", model.GetTypeInfo(x2Ref.First()).Type.ToDisplayString()); 7522Assert.Equal("(System.Int32 x, (System.String y, System.Boolean z))", model.GetTypeInfo(lhs).Type.ToTestDisplayString()); 7565Assert.Equal("int", model.GetTypeInfo(x1Ref).Type.ToDisplayString()); 7569Assert.Equal("string", model.GetTypeInfo(x2Ref).Type.ToDisplayString());
CodeGen\CodeGenFunctionPointersTests.cs (2)
10811typeInfo.Type.ToTestDisplayString(includeNonNullable: false)); 10818Assert.Null(typeInfo.Type);
CodeGen\CodeGenLocalFunctionTests.cs (1)
166Assert.Equal("System.Object", info.Type.ToTestDisplayString());
CodeGen\CodeGenRefLocalTests.cs (6)
4038Assert.Equal("System.Int32", model.GetTypeInfo(type).Type.ToTestDisplayString()); 4043Assert.Null(model.GetTypeInfo(refVar).Type); 4075Assert.Equal("C", model.GetTypeInfo(type).Type.ToTestDisplayString()); 4082Assert.Null(model.GetTypeInfo(refVar).Type); 4109Assert.Equal("System.Int32", model.GetTypeInfo(type).Type.ToTestDisplayString()); 4114Assert.Null(model.GetTypeInfo(refInt).Type);
CodeGen\CodeGenTupleEqualityTests.cs (80)
373Assert.Equal("System.Int32", xSymbol.Type.ToTestDisplayString()); 377Assert.Equal("(System.Int32, System.Int32)", tupleXSymbol.Type.ToTestDisplayString()); 390Assert.Equal("System.Byte", ySymbol.Type.ToTestDisplayString()); 394Assert.Equal("(System.Byte, System.Byte)", tupleYSymbol.Type.ToTestDisplayString()); 684Assert.Null(symbol1.Type); 690Assert.Equal("(System.String, System.Int32)", symbol2.Type.ToTestDisplayString()); 722Assert.Equal("(System.Int32, System.Byte)", tTypeInfo.Type.ToTestDisplayString()); 732Assert.Equal("(System.Int64, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 796Assert.Null(tupleType1.Type); 801Assert.Null(tuple1NullTypeInfo.Type); 809Assert.Null(tupleType2.Type); 814Assert.Null(tuple2NullTypeInfo.Type); 861Assert.Equal("(System.Int32, System.Int64)", t1TypeInfo.Type.ToTestDisplayString()); 870Assert.Equal("(System.Int64, System.Int32)", tupleType.Type.ToTestDisplayString()); 878Assert.Equal("System.Int32", twoType.Type.ToTestDisplayString()); 909Assert.Equal("(System.Int32, System.UInt64)", t1TypeInfo.Type.ToTestDisplayString()); 918Assert.Equal("(System.Int64, System.Int32)", tupleType.Type.ToTestDisplayString()); 926Assert.Equal("System.Int32", twoType.Type.ToTestDisplayString()); 958Assert.Equal("(System.Int32, (System.Int64, System.String))", t1TypeInfo.Type.ToTestDisplayString()); 967Assert.Equal("(System.Int64, (System.Int32, System.String) t2)", tupleType.Type.ToTestDisplayString()); 974Assert.Equal("(System.Int32, System.String)", t2TypeInfo.Type.ToTestDisplayString()); 1004Assert.Null(tupleType.Type); 1012Assert.Null(lastTupleTypeInfo.Type); 1019Assert.Null(nullNullTypeInfo.Type); 1026Assert.Null(lastNullTypeInfo.Type); 1062Assert.Equal("(System.String, System.String)", info.Type.ToTestDisplayString()); 1096Assert.Equal("(System.String, System.String)?", info.Type.ToTestDisplayString()); 1128Assert.Equal("(System.String, System.String)?", info.Type.ToTestDisplayString()); 1159Assert.Equal("System.Int32", info.Type.ToTestDisplayString()); 1217Assert.Equal("S?", type.Type.ToTestDisplayString()); 1314Assert.Null(model.GetTypeInfo(lastTuple).Type); 1319Assert.Equal("System.String", model.GetTypeInfo(lastDefault).Type.ToTestDisplayString()); 1405Assert.Null(model.GetTypeInfo(nullLiteral2).Type); 1414Assert.Null(model.GetTypeInfo(defaultLiteral).Type); 1470Assert.Null(model.GetTypeInfo(defaultLiteral).Type); 1501Assert.Null(tupleType.Type); 1510Assert.Equal("(System.String, System.String)", tType.Type.ToTestDisplayString()); 1521Assert.Null(nestedTupleType.Type); 1532Assert.Null(nestedNullType.Type); 1562Assert.Null(symbol.Type); 1571Assert.Null(symbol.Type); 1597Assert.Equal("System.Int32", literalInfo.Type.ToTestDisplayString()); 1622Assert.Null(literalInfo.Type); 1628Assert.Null(nestedLiteralInfo.Type); 1634Assert.Equal("System.Int32", twoInfo.Type.ToTestDisplayString()); 1679Assert.Null(tupleType1.Type); 1687Assert.Null(tupleType2.Type); 1692Assert.Null(model.GetTypeInfo(firstLambda).Type); 1697Assert.Null(model.GetTypeInfo(methodGroup).Type); 1704verifyType("System.Func<System.Int32, System.Int32>", model.GetTypeInfo(secondLambda).Type, inferDelegate); 1779Assert.Equal("(System.String, System.String)", tupleType1.Type.ToTestDisplayString()); 1785Assert.Null(tupleType2.Type); 1921Assert.Null(tupleType1.Type); 1927Assert.Null(tupleType2.Type); 2578Assert.Equal("(System.Int32, System.Int32)", intTupleType.Type.ToTestDisplayString()); 2586Assert.Equal("(C, C)", lastTupleType.Type.ToTestDisplayString()); 2646Assert.Equal("(System.Int32, System.Int32)?", t1Type.Type.ToTestDisplayString()); 3282Assert.Equal("(System.Int32, System.Int32)?", nt1Type.Type.ToTestDisplayString()); 3288Assert.Equal("(System.Int32, System.Int32)?", nt2Type.Type.ToTestDisplayString()); 3688Assert.Equal("(System.Int32, System.Int32)?", nt1Type.Type.ToTestDisplayString()); 3694Assert.Equal("(System.Int32, System.Int32)?", nt2Type.Type.ToTestDisplayString()); 3812Assert.Equal("(System.Int32, System.Int32)?", nt1Type.Type.ToTestDisplayString()); 3818Assert.Equal("(System.Byte, System.Int64)?", nt2Type.Type.ToTestDisplayString()); 3915Assert.Equal("(C, System.Int32)?", nt1Type.Type.ToTestDisplayString()); 3921Assert.Equal("(System.Int32, C)?", nt2Type.Type.ToTestDisplayString()); 4040Assert.Equal("(System.Int32, System.Int32)", tupleType.Type.ToTestDisplayString()); 4046Assert.Equal("(System.Byte, System.Int32)?", ntType.Type.ToTestDisplayString()); 4088Assert.Equal("(System.Int32, System.Int32)", tupleType.Type.ToTestDisplayString()); 4094Assert.Equal("(C, System.Int32)?", ntType.Type.ToTestDisplayString()); 4187Assert.Null(nullType.Type); 4280Assert.Equal("System.ValueTuple<System.Int32?>", left.Type.ToTestDisplayString()); 4282Assert.True(left.Type.IsTupleType); 5127Assert.Equal("(System.Int32 Alice, (System.Int32 Bob, System.Int32))", leftInfo.Type.ToTestDisplayString()); 5133Assert.Equal("(System.Int32 Bob, (System.Int32, System.Int32 Other))", rightInfo.Type.ToTestDisplayString()); 5164Assert.Equal("(System.String, (System.Byte, System.Int64))", leftCastInfo.Type.ToTestDisplayString()); 5172Assert.Null(leftTupleInfo.Type); 5180Assert.Null(leftNullInfo.Type); 5188Assert.Equal("(System.Int32, System.Int64)", leftNestedTupleInfo.Type.ToTestDisplayString()); 5195Assert.Equal("(System.String, (System.Int64, System.Byte))", rightCastInfo.Type.ToTestDisplayString()); 5202Assert.Null(rightTupleInfo.Type);
CodeGen\CodeGenTupleTest.cs (96)
1613Assert.Equal("(System.Int32, System.String, System.Int32 c)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 3471model.GetTypeInfo(node).Type.ToTestDisplayString()); 3639var type = (INamedTypeSymbol)model.GetTypeInfo(node).Type; 3689var yType = (INamedTypeSymbol)model.GetTypeInfo(yTuple).Type; 3706Assert.Equal("(System.Int32 x, System.Int32 b)", model.GetTypeInfo(zTuple).Type.ToTestDisplayString()); 3936model.GetTypeInfo(yTuple).Type.ToTestDisplayString()); 3939Assert.Equal("(System.Int32 x, System.Int32 b)", model.GetTypeInfo(zTuple).Type.ToTestDisplayString()); 3942Assert.Equal("(System.String, System.Int32 value)", model.GetTypeInfo(tTuple).Type.ToTestDisplayString()); 3995model.GetTypeInfo(yTuple).Type.ToTestDisplayString()); 4157Assert.Equal("(System.String, System.Int32)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 7572Assert.Null(model.GetTypeInfo(tuple1).Type); 7581Assert.Null(model.GetTypeInfo(tuple2).Type); 7590Assert.Null(model.GetTypeInfo(tuple3).Type); 7638Assert.Null(model.GetTypeInfo(tuple).Type); 8295Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8327Assert.Equal("System.Int32", model.GetTypeInfo(l11).Type.ToTestDisplayString()); 8334Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8341Assert.Equal("System.Int32", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8346Assert.Equal("System.String", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8352Assert.Equal("(System.Int16 c, System.String d)?", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 8382Assert.Equal("(System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()); 8410Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8439Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8446Assert.Equal("System.Int32", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8451Assert.Equal("System.String", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8457Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 8487Assert.Equal("(System.Int64 c, System.String d)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8494Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8521Assert.Equal("(System.Int64 c, System.String d)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8528Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8554Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8583Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8590Assert.Equal("System.Int32", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8595Assert.Equal("System.String", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8601Assert.Equal("(System.Int32 c, System.String d)?", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 8630Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8636Assert.Equal("(System.Int32 c, System.String d)", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 8665Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8694Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8723Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8754Assert.Equal("System.Int32", model.GetTypeInfo(l11).Type.ToTestDisplayString()); 8761Assert.Equal("(System.Int32 e, System.String f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8768Assert.Equal("System.Int32", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8773Assert.Equal("System.String", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8779Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 8808Assert.Null(model.GetTypeInfo(node).Type); 8839Assert.Null(model.GetTypeInfo(lnull).Type); 8846Assert.Null(model.GetTypeInfo(node).Type); 8852Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 8897Assert.Equal("(System.Int32 e, C.C1 f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8944Assert.Equal("(System.Int32 e, C.C1 f)", model.GetTypeInfo(node).Type.ToTestDisplayString()); 8951Assert.Equal("System.Int32", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8956Assert.Equal("C.C1", model.GetTypeInfo(element).Type.ToTestDisplayString()); 8962Assert.Equal("(System.Int16 c, System.String d)", model.GetTypeInfo(node.Parent).Type.ToTestDisplayString()); 9018Assert.Equal("(System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()); 9075Assert.Equal("(System.String, System.String)", typeInfo.Type.ToTestDisplayString()); 9147Assert.Equal("(System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()); 9228Assert.Equal("(System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()); 9311Assert.Null(typeInfo.Type); 13988Assert.Equal(typeInfo.Type, symbolInfo.Symbol); 13994Assert.True(typeInfo.Type.IsTupleType); 13996typeInfo.Type.ToTestDisplayString()); 13999Assert.True(typeInfo.Type.IsTupleType); 14001typeInfo.Type.ToTestDisplayString()); 14005Assert.False(typeInfo.Type.IsTupleType); 14006Assert.True(((INamedTypeSymbol)typeInfo.Type).IsUnboundGenericType); 16544Assert.Equal("(System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()); 17215Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(n1).Type.ToTestDisplayString()); 17222Assert.Null(model.GetTypeInfo(n2).Type); 17229Assert.Equal("System.Int32", model.GetTypeInfo(n3).Type.ToTestDisplayString()); 17236Assert.Null(model.GetTypeInfo(n4).Type); 17243Assert.Null(model.GetTypeInfo(n5).Type); 17276Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(n1).Type.ToTestDisplayString()); 17283Assert.Null(model.GetTypeInfo(n2).Type); 17290Assert.Equal("System.Int32", model.GetTypeInfo(n3).Type.ToTestDisplayString()); 17297Assert.Null(model.GetTypeInfo(n4).Type); 17304Assert.Null(model.GetTypeInfo(n5).Type); 17335Assert.Equal("(System.Int32, System.String)", model.GetTypeInfo(n1).Type.ToTestDisplayString()); 17342Assert.Null(model.GetTypeInfo(n2).Type); 24202Assert.Equal("(System.Int32 elem1, System.Int32 elem2)", typeInfo.Type.ToTestDisplayString()); 24204Assert.Equal(symbolInfo.Symbol, typeInfo.Type); 25056Assert.Equal("(?, ?)", yType.Type.ToTestDisplayString()); 25061Assert.Equal("(System.Int32 a, ?)", zType.Type.ToTestDisplayString()); 25087Assert.Equal("(System.Int32 Alice, ?)", tupleType.Type.ToTestDisplayString()); 25704Assert.Null(model.GetTypeInfo(tuple).Type); 25709Assert.Equal("System.Int32?", model.GetTypeInfo(first).Type.ToTestDisplayString()); 25714Assert.Null(model.GetTypeInfo(second).Type); 25775Assert.Null(model.GetTypeInfo(tuple).Type); 25780Assert.Equal("System.Int32?", model.GetTypeInfo(first).Type.ToTestDisplayString()); 25785Assert.Null(model.GetTypeInfo(second).Type); 25840Assert.Null(model.GetTypeInfo(tuple).Type); 25845Assert.Equal("System.Int32?", model.GetTypeInfo(first).Type.ToTestDisplayString()); 25850Assert.Null(model.GetTypeInfo(second).Type); 25882Assert.Equal("(System.Int32, System.Int32)", model.GetTypeInfo(tuple).Type.ToTestDisplayString()); 25912Assert.Equal("(System.Int32? e, System.String)", model.GetTypeInfo(tuple).Type.ToTestDisplayString()); 26228Assert.Null(tupleSymbol.Type);
CodeGen\IndexAndRangeTests.cs (2)
3862Assert.Equal("C", model.GetTypeInfo(receivers[0]).Type.ToTestDisplayString()); 3865Assert.Equal("C", model.GetTypeInfo(receivers[1]).Type.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\NumericIntPtrTests.cs (1)
6016Assert.Equal(AsNative(sourceType), typeInfo.Type.ToString());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (306)
Attributes\AttributeTests.cs (3)
11639Assert.Equal("System.Int32", model.GetTypeInfo(firstArgument.Expression).Type.ToTestDisplayString()); 11643Assert.Null(model.GetTypeInfo(secondArgument.Expression).Type); 11647Assert.Equal("System.Int32", model.GetTypeInfo(thirdArgument.Expression).Type.ToTestDisplayString());
FieldKeywordTests.cs (1)
9479return (model.GetConstantValue(value).Value, typeInfo.Type.ToTestDisplayString(), typeInfo.ConvertedType.ToTestDisplayString());
FirstClassSpanTests.cs (1)
2735Assert.Equal(sourceType, argType.Type.ToTestDisplayString());
Semantics\CollectionExpressionTests.cs (23)
14313Assert.Null(typeInfo.Type); 14389Assert.Null(typeInfo.Type); 14454Assert.Null(typeInfo.Type); 14523Assert.Null(typeInfo.Type); 14648Assert.Null(typeInfo.Type); 14728Assert.Null(typeInfo.Type); 14823Assert.Null(typeInfo.Type); 15166Assert.Equal(expectedType, typeInfo.Type?.ToTestDisplayString()); 28703Assert.Null(typeInfo2.Type); 28747Assert.Null(typeInfo2.Type); 28791Assert.Null(model.GetTypeInfo(collections[0]).Type); 28796Assert.Null(model.GetTypeInfo(collections[1]).Type); 28837Assert.Null(typeInfo2.Type); 28880Assert.Null(typeInfo2.Type); 29030Assert.Null(typeInfo2.Type); 29038Assert.Null(typeInfo3.Type); 29083Assert.Null(typeInfo2.Type); 29091Assert.Null(typeInfo3.Type); 29147Assert.Null(typeInfo2.Type); 29154Assert.Null(typeInfo3.Type); 29208Assert.Null(typeInfo2.Type); 29215Assert.Null(typeInfo3.Type); 41621Assert.Equal("MyCollection<System.Object>", info.Type.ToTestDisplayString());
Semantics\InlineArrayTests.cs (22)
2364Assert.Equal("C", typeInfo.Type.ToTestDisplayString()); 2399Assert.Equal("C", typeInfo.Type.ToTestDisplayString()); 2433Assert.Equal("C", typeInfo.Type.ToTestDisplayString()); 2513Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 2523Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 6038Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 6204Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 6214Assert.Equal("System.Span<System.Int32>", typeInfo.Type.ToTestDisplayString()); 8123Assert.True(typeInfo.Type.IsErrorType()); 8840Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 8850Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 9208Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 10552Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 10562Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 11296Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 11306Assert.Equal("System.ReadOnlySpan<System.Int32>", typeInfo.Type.ToTestDisplayString()); 15213Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 15220Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 16500Assert.Equal("Buffer10<System.Int32>", typeInfo.Type.ToTestDisplayString()); 18588Assert.Equal("Buffer4<System.Int32>", typeInfo.Type.ToTestDisplayString()); 18914Assert.Equal("Buffer4<System.Int32>", typeInfo.Type.ToTestDisplayString()); 19251Assert.Equal("Buffer4<System.Int32>", typeInfo.Type.ToTestDisplayString());
Semantics\OutVarTests.cs (86)
994Assert.Equal(local.Type, model.GetTypeInfo(reference).Type); 1017Assert.Equal(expectedType, typeInfo.Type); 1053Assert.Equal(expected, typeInfo.Type); 4013Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 5119Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 8813Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 9652Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 10220Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 10869Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 13349Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 13748Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 14261Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14308Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14357Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14399Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14441Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14486Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14528Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14572Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14576Assert.Equal("System.Boolean", model.GetTypeInfo(zRef).Type.ToTestDisplayString()); 14622Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14676Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14735Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14781Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14785Assert.Equal("System.Boolean", model.GetTypeInfo(zRef).Type.ToTestDisplayString()); 14831Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 14835Assert.Equal("System.Boolean", model.GetTypeInfo(zRef).Type.ToTestDisplayString()); 15269Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 16547Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 17106Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 17542Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 18449Assert.Equal("System.Void", typeInfo.Type.ToTestDisplayString()); 19368Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref).Type.ToTestDisplayString()); 19689Assert.True(compilation.GetSemanticModel(tree).GetTypeInfo(x1Ref).Type.TypeKind == TypeKind.Error); 19732Assert.True(compilation.GetSemanticModel(tree).GetTypeInfo(x1Ref).Type.TypeKind == TypeKind.Error); 19845Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 19878Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 19911Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 19946Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 19981Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 20363Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 20369Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(x2Ref[0]).Type.ToTestDisplayString()); 20375Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(x3Ref[0]).Type.ToTestDisplayString()); 20381Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(x4Ref[0]).Type.ToTestDisplayString()); 20617Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(x1Ref).Type.ToTestDisplayString()); 20662Assert.True(compilation.GetSemanticModel(tree).GetTypeInfo(x4Ref).Type.TypeKind == TypeKind.Error); 20777Assert.True(model.GetTypeInfo(x1Ref).Type.TypeKind == TypeKind.Error); 20780Assert.True(model.GetTypeInfo(x2Ref).Type.TypeKind == TypeKind.Error); 20783Assert.True(model.GetTypeInfo(x3Ref).Type.TypeKind == TypeKind.Error); 20786Assert.True(model.GetTypeInfo(x4Ref).Type.TypeKind == TypeKind.Error); 21306Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 21414Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 21418Assert.True(((ITypeSymbol)model.GetTypeInfo(zRef).Type).IsErrorType()); 22673Assert.True(((ITypeSymbol)model.GetTypeInfo(reference).Type).IsErrorType()); 32731Assert.Equal(local.Type, model.GetTypeInfo(reference).Type); 32904Assert.Equal("System.String", model.GetTypeInfo(x1Ref).Type.ToTestDisplayString()); 32932Assert.Null(model.GetTypeInfo(discard1).Type); 32936Assert.Equal("System.Int32", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 32941Assert.Null(model.GetTypeInfo(discard2).Type); 32945Assert.Equal("System.Int32", model.GetTypeInfo(declaration2).Type.ToTestDisplayString()); 32952Assert.Equal("System.Int32", model.GetTypeInfo(discard3).Type.ToTestDisplayString()); 33020Assert.Equal("System.Int32", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 33026Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 33036Assert.Equal("System.Int32", model.GetTypeInfo(declaration2).Type.ToTestDisplayString()); 33042Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 33048Assert.Equal("System.Int32", model.GetTypeInfo(discard3).Type.ToTestDisplayString()); 33092Assert.Equal("System.Int64", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 33098Assert.Equal("System.Int64", typeInfo.Type.ToTestDisplayString()); 33134Assert.Equal("System.Int32", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 33140Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 33150Assert.Equal("System.Int32", model.GetTypeInfo(declaration2).Type.ToTestDisplayString()); 33156Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 33198Assert.Equal("alias1", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 33204Assert.Equal("alias1", typeInfo.Type.ToTestDisplayString()); 33214Assert.Equal("var", model.GetTypeInfo(declaration2).Type.ToTestDisplayString()); 33215Assert.Equal(TypeKind.Class, model.GetTypeInfo(declaration2).Type.TypeKind); 33221Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 33222Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 33223Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 33647Assert.Equal("System.Int32", model.GetTypeInfo(z1).Type.ToTestDisplayString()); 35321Assert.Equal("var", model.GetTypeInfo(decl).Type.ToTestDisplayString()); // crashes 35357Assert.Equal("var", model.GetTypeInfo(decl).Type.ToTestDisplayString()); // crashes 35396Assert.Equal("var", model.GetTypeInfo(decl).Type.ToTestDisplayString()); // crashes 35426Assert.Equal("var", model.GetTypeInfo(decl).Type.ToTestDisplayString()); // crashes 35463Assert.Equal("var", model.GetTypeInfo(decl).Type.ToTestDisplayString()); // crashes 35513Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(xRef[0]).Type.ToTestDisplayString());
Semantics\ParamsCollectionTests.cs (8)
175Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 231Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 347Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 530Assert.Equal("System.Char", typeInfo.Type.ToTestDisplayString()); 675Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 1419Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 2543Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 2679Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString());
Semantics\PatternMatchingTestBase.cs (6)
134Assert.Equal(expectedType, typeInfo.Type); 315Assert.Equal(local.Type, model.GetTypeInfo(reference).Type); 372Assert.Null(model.GetTypeInfo(designation).Type); 386Assert.Equal(type, typeInfo.Type); 391Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 413Assert.True(model.GetTypeInfo(reference).Type.IsErrorType());
Semantics\PatternMatchingTests.cs (15)
3449Assert.Equal(SymbolKind.NamedType, typeInfo1.Type.Kind); 3450Assert.Equal("System.Boolean", typeInfo1.Type.ToTestDisplayString()); 3453Assert.Equal(SymbolKind.NamedType, typeInfo1.Type.Kind); 3454Assert.Equal("System.Int32", typeInfo1.Type.ToTestDisplayString()); 3459Assert.Equal(SymbolKind.NamedType, typeInfo2.Type.Kind); 3460Assert.Equal("System.Int32", typeInfo2.Type.ToTestDisplayString()); 3482Assert.True(((ITypeSymbol)compilation.GetSemanticModel(tree).GetTypeInfo(x1Ref).Type).IsErrorType()); 3488Assert.True(((ITypeSymbol)compilation.GetSemanticModel(tree).GetTypeInfo(x2Ref).Type).IsErrorType()); 4253Assert.Equal("System.Collections.Generic.IEnumerable<System.String>", model.GetTypeInfo(x2Ref).Type.ToTestDisplayString()); 4295Assert.Equal("System.Int32", model.GetTypeInfo(declaration1).Type.ToTestDisplayString()); 4296Assert.Equal("System.Int32", model.GetTypeInfo(declaration1.Type).Type.ToTestDisplayString()); 4309Assert.Equal("System.Int32", model.GetTypeInfo(declaration3).Type.ToTestDisplayString()); 4310Assert.Equal("System.Int32", model.GetTypeInfo(declaration3.Type).Type.ToTestDisplayString()); 6575Assert.Equal("System.Int32", model.GetTypeInfo(caseDefault.Pattern).Type.ToTestDisplayString()); 11370Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType);
Semantics\PatternMatchingTests_ListPatterns.cs (9)
3649Assert.Null(typeInfo.Type); 3652Assert.Equal(type, typeInfo.Type.ToDisplayString()); 3691Assert.Equal(type, typeInfo.Type.ToDisplayString()); 3730Assert.Null(typeInfo.Type); 3734Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 3745Assert.Null(typeInfo.Type); 3749Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4419Assert.Null(typeInfo.Type); 4422Assert.Equal(type, typeInfo.Type.ToDisplayString());
Semantics\PatternMatchingTests_Scope.cs (38)
418Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 723Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 992Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 1296Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 5352Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 6482Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 6893Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 7222Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 7545Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 9651Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 10214Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 10730Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 11134Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11182Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11232Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11275Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11318Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11364Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11407Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 11451Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(yRef).Type.ToTestDisplayString()); 11454Assert.Equal("System.Boolean", compilation.GetSemanticModel(tree).GetTypeInfo(zRef).Type.ToTestDisplayString()); 11497Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(xRef).Type.ToTestDisplayString()); 11500Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(yRef).Type.ToTestDisplayString()); 11503Assert.Equal("System.Boolean", compilation.GetSemanticModel(tree).GetTypeInfo(zRef).Type.ToTestDisplayString()); 11549Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(xRef).Type.ToTestDisplayString()); 11556Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(yRef).Type.ToTestDisplayString()); 11612Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(xRef).Type.ToTestDisplayString()); 11615Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(yRef).Type.ToTestDisplayString()); 11667Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(y1Ref).Type.ToTestDisplayString()); 11670Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(z0Ref).Type.ToTestDisplayString()); 11673Assert.Equal("System.Boolean", compilation.GetSemanticModel(tree).GetTypeInfo(z1Ref).Type.ToTestDisplayString()); 11727Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(y1Ref).Type.ToTestDisplayString()); 11730Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(z0Ref).Type.ToTestDisplayString()); 11733Assert.Equal("System.Int32", compilation.GetSemanticModel(tree).GetTypeInfo(z1Ref).Type.ToTestDisplayString()); 11736Assert.Equal("System.Boolean", compilation.GetSemanticModel(tree).GetTypeInfo(z2Ref).Type.ToTestDisplayString()); 12156Assert.Equal("System.Int32", model.GetTypeInfo(x1Ref[0]).Type.ToTestDisplayString()); 12252Assert.Equal("System.Int32", model.GetTypeInfo(yRef).Type.ToTestDisplayString()); 12256Assert.True(model.GetTypeInfo(zRef).Type.IsErrorType());
Semantics\PatternMatchingTests2.cs (20)
731Assert.Equal("int", typeInfo.Type.ToDisplayString()); 2028Assert.Equal(SpecialType.System_Boolean, typeInfo.Type.SpecialType); 2069Assert.Equal(SpecialType.System_Boolean, typeInfo.Type.SpecialType); 2165Assert.Equal(ex.Type, typeInfo.Type.ToTestDisplayString()); 2256Assert.Equal("T1", ti.Type.ToTestDisplayString()); 2261Assert.Equal("T3", ti.Type.ToTestDisplayString()); 2266Assert.Equal("T4", ti.Type.ToTestDisplayString()); 2271Assert.Equal("T5", ti.Type.ToTestDisplayString()); 2300Assert.Equal("System.Object", ti.Type.ToTestDisplayString()); 2305Assert.Equal("System.Object", ti.Type.ToTestDisplayString()); 2310Assert.Equal("System.IComparable", ti.Type.ToTestDisplayString()); 2346Assert.Equal("System.Object", ti.Type.ToTestDisplayString()); 2351Assert.Equal("?", ti.Type.ToTestDisplayString()); 2352Assert.Equal(TypeKind.Error, ti.Type.TypeKind); 2357Assert.Equal("?", ti.Type.ToTestDisplayString()); 2358Assert.Equal(TypeKind.Error, ti.Type.TypeKind); 2363Assert.Equal("?", ti.Type.ToTestDisplayString()); 2364Assert.Equal(TypeKind.Error, ti.Type.TypeKind); 2370Assert.Equal("System.Object", ti.Type.ToTestDisplayString()); 2876Assert.Equal(expectedNaturalType, typeInfo.Type?.ToTestDisplayString());
Semantics\PatternMatchingTests3.cs (56)
4118Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4124Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4132Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4134Assert.Equal("System.Int32", model.GetTypeInfo(((ConstantPatternSyntax)pattern).Expression).Type.ToTestDisplayString()); 4140Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4146Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4153Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4161Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4167Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4176Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4182Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4189Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4196Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4202Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4208Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4214Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4221Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4228Assert.Equal("System.Char", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4234Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4240Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4247Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4254Assert.Equal("System.Char", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4260Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4266Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4272Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4279Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4286Assert.Equal("System.Char", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4345Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4351Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4359Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4361Assert.Equal("System.Int32", model.GetTypeInfo(((ConstantPatternSyntax)pattern).Expression).Type.ToTestDisplayString()); 4367Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4373Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4380Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4388Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4394Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4396Assert.Equal("System.Int32", model.GetTypeInfo(((ConstantPatternSyntax)pattern).Expression).Type.ToTestDisplayString()); 4402Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4410Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4416Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4423Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4430Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4436Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4442Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4448Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4455Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4462Assert.Equal("System.Char", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4468Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4474Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4481Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4488Assert.Equal("System.Char", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4494Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4500Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4506Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4513Assert.Equal("System.Object", model.GetTypeInfo(pattern).Type.ToTestDisplayString()); 4520Assert.Equal("System.Char", model.GetTypeInfo(pattern).Type.ToTestDisplayString());
Semantics\PatternMatchingTests5.cs (6)
1299Assert.Equal("C", xyType.Type.ToTestDisplayString()); 1307Assert.Equal("S?", xType.Type.ToTestDisplayString()); 1315Assert.Equal("C", yNameType.Type.ToTestDisplayString()); 1326Assert.Equal("S?", yxType.Type.ToTestDisplayString()); 1334Assert.Equal("C", yType.Type.ToTestDisplayString()); 1342Assert.Equal("S?", xNameType.Type.ToTestDisplayString());
Semantics\PatternSwitchTests.cs (5)
1516Assert.Equal("System.String", model.GetTypeInfo(sRef).Type.ToTestDisplayString()); 1518Assert.Equal("System.Object", model.GetTypeInfo(iRef).Type.ToTestDisplayString()); 1520Assert.Equal("System.String", model.GetTypeInfo(s2Ref).Type.ToTestDisplayString()); 1522Assert.Equal("System.Object", model.GetTypeInfo(i2Ref).Type.ToTestDisplayString()); 3288Assert.Equal(SpecialType.System_Boolean, type.Type.SpecialType);
Semantics\PrimaryConstructorTests.cs (3)
1087Assert.Equal("Base", model.GetTypeInfo(baseWithargs.Type).Type.ToTestDisplayString()); 2120Assert.Equal("Base", model.GetTypeInfo(baseWithargs.Type).Type.ToTestDisplayString()); 2302Assert.Equal("Base", model.GetTypeInfo(baseWithargs.Type).Type.ToTestDisplayString());
Semantics\RecordTests.cs (4)
8607Assert.True(c.ISymbol.Equals(typeInfo.Type)); 21159Assert.Equal("Base", model.GetTypeInfo(baseWithargs.Type).Type.ToTestDisplayString()); 22232Assert.Equal("Base", model.GetTypeInfo(baseWithargs.Type).Type.ToTestDisplayString()); 22414Assert.Equal("Base", model.GetTypeInfo(baseWithargs.Type).Type.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
616var type = model.GetTypeInfo(literal).Type;
Microsoft.CodeAnalysis.CSharp.Features (110)
AddImport\CSharpAddImportFeatureService.cs (3)
238return semanticModel.GetTypeInfo(node, cancellationToken).Type; 267return semanticModel.GetTypeInfo(fromClause.Expression, cancellationToken).Type; 619var leftExpressionType = semanticInfo.Type;
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
225if (within != null && semanticModel.GetTypeInfo(attribute, cancellationToken).Type is INamedTypeSymbol attributeType) 241var attributeType = (INamedTypeSymbol?)semanticModel.GetTypeInfo(attribute, cancellationToken).Type;
Completion\CompletionProviders\AwaitCompletionProvider.cs (2)
113return symbol is ITypeSymbol ? null : semanticModel.GetTypeInfo(memberAccessExpression, cancellationToken).Type; 122return semanticModel.GetTypeInfo(potentialAwaitableExpression, cancellationToken).Type;
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
213var leftType = semanticModel.GetTypeInfo(parent.Container, cancellationToken).Type;
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (2)
263semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type, 305semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type,
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
292var methodParameterType = semanticModel.GetTypeInfo(parameterType, cancellationToken).Type;
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (4)
174if (semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type is INamedTypeSymbol type && within != null && type.TypeKind != TypeKind.Delegate) 190var expressionType = semanticModel.GetTypeInfo(elementAccessExpression.Expression, cancellationToken).Type; 242var type = semanticModel.GetTypeInfo(baseType.Type, cancellationToken).Type as INamedTypeSymbol; 258var expressionType = semanticModel.GetTypeInfo(invocationExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (3)
85var initializedType = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 153return semanticModel.GetTypeInfo(parent, cancellationToken).Type; 168return semanticModel.GetTypeInfo(withExpression.Expression, cancellationToken).Type;
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
70returnType = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type;
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
69model.GetTypeInfo(foreachCollectionExpression, cancellationToken).Type ??
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (6)
432if (typeCheckMethod(_semanticModel.GetTypeInfo(expressionToVerifyType, _cancellationToken).Type) && 555if (returnTypeInfo.Type.OriginalDefinition?.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T) 557returnedType = returnTypeInfo.Type; 665var forEachStatementTypeSymbolType = _semanticModel.GetTypeInfo(forEachStatement.Type, _cancellationToken).Type; 667if (Equals(lastSelectExpressionTypeInfo.ConvertedType, lastSelectExpressionTypeInfo.Type) && 882if (_semanticModel.GetTypeInfo(selectClause.Expression, _cancellationToken).Type.ContainsAnonymousType())
Debugging\DataTipInfoGetter.cs (2)
47var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 80var type = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type;
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (4)
42if (Microsoft.CodeAnalysis.Shared.Extensions.ISymbolExtensions.IsErrorType(info.Type)) 47return info.Type == null || info.Type.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object 48? info.Type
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (2)
120var type = _semanticModel.GetSpeculativeTypeInfo(_contextPosition, statement.Declaration.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 185var semanticInfo = _semanticModel.GetSpeculativeTypeInfo(_contextPosition, declarationStatement.Declaration.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (4)
59return (model.GetTypeInfo(variableDeclExpression.Type).Type, returnsByRef: false); 74return (model.GetTypeInfo(castExpression).Type, returnsByRef: false); 119if (info.Type?.SpecialType == SpecialType.System_String && 126return !info.Type.IsObjectType() ? info.GetTypeWithAnnotatedNullability() : info.GetConvertedTypeWithAnnotatedNullability();
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
77typeToGenerateIn = info.Type as INamedTypeSymbol;
GenerateType\CSharpGenerateTypeService.cs (1)
459var expressionType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
InlineHints\CSharpInlineTypeHintsService.cs (3)
42var type = semanticModel.GetTypeInfo(variableDeclaration.Type, cancellationToken).Type; 52var type = semanticModel.GetTypeInfo(declarationExpression.Type, cancellationToken).Type; 96var type = semanticModel.GetTypeInfo(implicitNew, cancellationToken).Type;
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
130if (typeInfo.Type?.IsValueType == true)
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
83if (semanticModel.GetTypeInfo(attribute, cancellationToken).Type is not INamedTypeSymbol attributeType)
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
191expressionType = semanticModel.GetTypeInfo(memberAccessExpression.Expression, cancellationToken).Type!; 203expressionType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
100: semanticModel.GetTypeInfo(beforeDotExpression, cancellationToken).Type as INamespaceOrTypeSymbol;
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
82var invokedType = semanticModel.GetTypeInfo(invocationExpression.Expression, cancellationToken).Type; 129var invokedType = semanticModel.GetTypeInfo(invocationExpression.Expression, cancellationToken).Type;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
54throughType = semanticModel.GetTypeInfo(throughExpression, cancellationToken).Type;
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (1)
71if (semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type is not INamedTypeSymbol type)
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
87if (semanticModel.GetTypeInfo(baseTypeSyntax.Type, cancellationToken).Type is not INamedTypeSymbol baseType)
Snippets\CSharpSnippetFunctionService.cs (1)
42var typeSymbol = model.GetTypeInfo(expressionNode, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
92if (syntaxContext.SemanticModel.GetTypeInfo(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (5)
183var expressionType = semanticModel.GetTypeInfo(memberAccess.Expression, cancellationToken).Type; 250var argumentType = semanticModel.GetTypeInfo(objectCreation.ArgumentList.Arguments[0].Expression, cancellationToken).Type; 339var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 350var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type; 433var type = state.SemanticModel.GetTypeInfo(memberAccess.Expression, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (7)
93if (originalTypeInfo.Type is IErrorTypeSymbol) 110if (originalTypeInfo.Type != null && 111!originalTypeInfo.Type.Equals(originalTypeInfo.ConvertedType) && 126return IsConstructibleCollectionType(compilation, semanticModel.GetTypeInfo(parent, cancellationToken).Type); 172var type = originalTypeInfo.Type; 598semanticModel.GetTypeInfo(expression, cancellationToken).Type?.IsValueType == true; 626=> semanticModel.GetTypeInfo(expression, cancellationToken).Type is not null and not IErrorTypeSymbol;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
164if (semanticModel.GetTypeInfo(testedExpression, cancellationToken).Type is IPointerTypeSymbol or IFunctionPointerTypeSymbol)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
167var type = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
145var leftType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type; 146var rightType = semanticModel.GetTypeInfo(objectCreation, cancellationToken).Type;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
76if (semanticModel.GetTypeInfo(castExpression.Type).Type?.SpecialType == SpecialType.System_Object) 78var expressionType = semanticModel.GetTypeInfo(castExpression.Expression).Type;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
90var castType = semanticModel.GetTypeInfo(castExpression.Type).Type; 130var asType = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type; 254if (rightType.Type is null or { NullableAnnotation: NullableAnnotation.Annotated })
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
113var isType = semanticModel.GetTypeInfo(castExpression.Type).Type;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
83=> semanticModel.GetTypeInfo(type, cancellationToken).Type.IsNullable()
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (2)
97var leftType = semanticModel.GetTypeInfo(assignmentExpression.Left).Type; 98var rightType = semanticModel.GetTypeInfo(assignmentExpression.Right).Type;
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (3)
194typeInfo.Type is not null && 195!Equals(typeInfo.ConvertedType, typeInfo.Type)) 197var conversion = _semanticModel.Compilation.ClassifyConversion(typeInfo.Type, typeInfo.ConvertedType);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
286=> iEquatable.Equals(semanticModel.GetTypeInfo(baseItem.Type, cancellationToken).Type));
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (3)
76var returnedType = semanticModel.GetTypeInfo(returnedValue, cancellationToken).Type; 91var previousReturnType = semanticModel.GetTypeInfo(declarationTypeToFix, cancellationToken).Type; 168var type = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
161if (typeInfo.Type is INamedTypeSymbol typeSymbol)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
78type = model.GetTypeInfo(assignment.Right).Type; 83type = model.GetTypeInfo(deconstruction.Parent).Type;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (3)
143typeToGenerateIn = document.SemanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type as INamedTypeSymbol; 145|| document.SemanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type is not INamedTypeSymbol parameterSymbol 176|| document.SemanticModel.GetTypeInfo(expression, cancellationToken).Type is not INamedTypeSymbol parameterSymbol
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (2)
55type: semanticModel.GetTypeInfo(((ConstantPatternSyntax)positionalPattern.Subpatterns[i].Pattern).Expression, cancellationToken).Type ?? semanticModel.Compilation.GetSpecialType(SpecialType.System_Object), 60var targetType = semanticModel.GetTypeInfo(target, cancellationToken: cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
67typeToGenerateIn = semanticInfo.Type as INamedTypeSymbol;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
121if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter) 159result.Add(typeInfo.Type);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
97returnExpressionType = info.Type;
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
126semanticModel.GetTypeInfo(implicitObjectCreation).Type is { } type)
src\Analyzers\CSharp\CodeFixes\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (3)
27var leftPartTypeSymbol = semanticModel.GetTypeInfo(expressionToCoalesce, cancellationToken).Type; 28var rightPartTypeSymbol = semanticModel.GetTypeInfo(rightAssignmentPart, cancellationToken).Type; 29var finalDestinationTypeSymbol = semanticModel.GetTypeInfo(leftAssignmentPart, cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
97var type = semanticModel.GetTypeInfo(coalesce, cancellationToken).Type;
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
113var type = semanticModel.GetTypeInfo(expr).Type; 127var governingType = semanticModel.GetTypeInfo(p.Target.Syntax).Type.RemoveNullableIfPresent();
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
141if (asExpressionTypeInfo.Type != null) 145var asType = asExpressionTypeInfo.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
45var argType = semanticModel.GetTypeInfo(GetArgumentExpression(argument)).Type;
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
125var typeSymbol = semanticModel.GetTypeInfo(type, cancellationToken).Type;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (5)
IOperation\IOperationTests_IConversionExpression.cs (2)
179Assert.Null(typeInfo.Type); 5387Assert.Equal(ConversionChildSelector(conversion).Type, typeInfo.Type);
IOperation\IOperationTests_IFixedStatement.cs (1)
695Assert.Equal("System.Int32*", info.Type.ToTestDisplayString());
IOperation\IOperationTests_IVariableDeclaration.cs (2)
930Assert.Equal("System.Int32", model.GetTypeInfo(literalExpr).Type.ToTestDisplayString()); 937Assert.Equal("System.Int32", model.GetTypeInfo(invocExpr).Type.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (976)
Semantics\BindingTests.cs (1)
3941Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString());
Semantics\ConditionalOperatorTests.cs (2)
1299Assert.Equal(expectedType, model.GetTypeInfo(conditionalExpr).Type.ToTestDisplayString()); 1303Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(conditionalExpr.Condition).Type!.SpecialType);
Semantics\DeconstructionTests.cs (177)
3768Assert.Equal("(int, int)", model.GetTypeInfo(literal1).Type.ToDisplayString()); 3771Assert.Equal("(int, int)", model.GetTypeInfo(literal2).Type.ToDisplayString()); 4261Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 4262Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4269Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 4271Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4272Assert.Equal(TypeKind.Struct, typeInfo.Type.TypeKind); 4273Assert.Equal(TypeKind.Error, ((INamedTypeSymbol)typeInfo.Type).TypeArguments[0].TypeKind); 4274Assert.Equal(TypeKind.Error, ((INamedTypeSymbol)typeInfo.Type).TypeArguments[1].TypeKind); 4284Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 4285Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4286Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4290Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 4291Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4292Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4302Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4303Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4307Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4308Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4316Assert.Equal("((var a, var b), var c, System.Int32 d)", typeInfo.Type.ToTestDisplayString()); 4317Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4396Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 4397Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4404Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 4415Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 4416Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4417Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4421Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 4422Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4423Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4433Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4434Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4438Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4439Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4447Assert.Equal("((var a, var b), var c, System.Int32 d)", typeInfo.Type.ToTestDisplayString()); 4448Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4520Assert.Equal("(var, var)", typeInfo.Type.ToTestDisplayString()); 4521Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4528Assert.Equal("(var, var)", typeInfo.Type.ToTestDisplayString()); 4530Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4531Assert.Equal(TypeKind.Struct, typeInfo.Type.TypeKind); 4532Assert.Equal(TypeKind.Error, ((INamedTypeSymbol)typeInfo.Type).TypeArguments[0].TypeKind); 4533Assert.Equal(TypeKind.Error, ((INamedTypeSymbol)typeInfo.Type).TypeArguments[1].TypeKind); 4543Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 4544Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4545Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4552Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 4553Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 4554Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4564Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4565Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4572Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4573Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4581Assert.Equal("((var, var), var, System.Int32)", typeInfo.Type.ToTestDisplayString()); 4582Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4670Assert.Equal("(System.Int32 a, System.Int32 b)", typeInfo.Type.ToTestDisplayString()); 4671Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4678Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4689Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4690Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4694Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4695Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4726var aaType = model.GetTypeInfo(aa).Type.GetSymbol(); 4764Assert.Equal("(System.Int32 a, System.Int32 b)", typeInfo.Type.ToTestDisplayString()); 4765Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4772Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4783Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4784Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4788Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4789Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4842Assert.Equal("(System.Int32, System.Int32)", typeInfo.Type.ToTestDisplayString()); 4843Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4850Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4861Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4862Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4869Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4870Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4946Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4947Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4951Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4952Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4992Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4993Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4997Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4998Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5050Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5051Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5058Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5059Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5210Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 5211Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5218Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 5229Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 5230Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5231Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5235Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 5236Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5237Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5247Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5248Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5252Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5253Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5264Assert.Equal("(((var a, var b), var c), System.Int32 d)", typeInfo.Type.ToTestDisplayString()); 5265Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5274Assert.Equal("((var a, var b), var c)", typeInfo.Type.ToTestDisplayString()); 5275Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5354Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 5355Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5362Assert.Equal("(var a, var b)", typeInfo.Type.ToTestDisplayString()); 5373Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 5374Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5375Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5379Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 5380Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5381Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5391Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5392Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5396Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5397Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5408Assert.Equal("(((var a, var b), var c), System.Int32 d)", typeInfo.Type.ToTestDisplayString()); 5409Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5418Assert.Equal("((var a, var b), var c)", typeInfo.Type.ToTestDisplayString()); 5419Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5491Assert.Equal("(var, var)", typeInfo.Type.ToTestDisplayString()); 5492Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5499Assert.Equal("(var, var)", typeInfo.Type.ToTestDisplayString()); 5510Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 5511Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5512Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5519Assert.Equal("var", typeInfo.Type.ToTestDisplayString()); 5520Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 5521Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5531Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5532Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5539Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5540Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5551Assert.Equal("(((var, var), var), System.Int32)", typeInfo.Type.ToTestDisplayString()); 5552Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5561Assert.Equal("((var, var), var)", typeInfo.Type.ToTestDisplayString()); 5562Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5678Assert.Equal("((var a, var b), var c)", typeInfo.Type.ToTestDisplayString()); 5679Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5686Assert.Equal("((var a, var b), var c)", typeInfo.Type.ToTestDisplayString()); 5697Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5698Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5702Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5703Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5711Assert.Equal("(((var a, var b), var c), System.Int32 d)", typeInfo.Type.ToTestDisplayString()); 5712Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5788Assert.Equal("((var a, var b), var c)", typeInfo.Type.ToTestDisplayString()); 5789Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5796Assert.Equal("((var a, var b), var c)", typeInfo.Type.ToTestDisplayString()); 5807Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5808Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5812Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5813Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5821Assert.Equal("(((var a, var b), var c), System.Int32 d)", typeInfo.Type.ToTestDisplayString()); 5822Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5891Assert.Equal("((var, var), var)", typeInfo.Type.ToTestDisplayString()); 5892Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5899Assert.Equal("((var, var), var)", typeInfo.Type.ToTestDisplayString()); 5910Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5911Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5918Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 5919Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5927Assert.Equal("(((var, var), var), System.Int32)", typeInfo.Type.ToTestDisplayString()); 5928Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 5988Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 5999Assert.Null(type.Type); 6031Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6042Assert.Null(type.Type); 6071Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6082Assert.Null(type.Type); 6113Assert.Equal(SpecialType.System_Int32, type.Type.SpecialType); 6124Assert.Null(type.Type); 6153Assert.Equal(SpecialType.System_Void, type.Type.SpecialType); 6164Assert.Null(type.Type);
Semantics\DelegateTypeTests.cs (54)
751Assert.Null(typeInfo.Type); 798Assert.Null(typeInfo.Type); 897Assert.Equal(expectedDisplayString, typeInfo.Type?.ToTestDisplayString()); 903if (typeInfo.Type is { }) 905Assert.True(HaveMatchingSignatures(((INamedTypeSymbol)typeInfo.Type!).DelegateInvokeMethod!, method)); 940Assert.Null(typeInfo.Type); 946if (typeInfo.Type is { }) 948Assert.True(HaveMatchingSignatures(((INamedTypeSymbol)typeInfo.Type!).DelegateInvokeMethod!, method)); 1000Assert.Null(typeInfo.Type); 1004Assert.Equal($"System.Linq.Expressions.Expression<{expectedType}>", typeInfo.Type.ToTestDisplayString()); 1038Assert.Null(typeInfo.Type); 1213Assert.Null(typeInfo.Type); 1249Assert.Null(typeInfo.Type); 1334Assert.Null(typeInfo.Type); 1374Assert.Null(typeInfo.Type); 1417Assert.Null(typeInfo.Type); 1461Assert.Null(typeInfo.Type); 1556Assert.Null(typeInfo.Type); 1636Assert.Null(typeInfo.Type); 1686Assert.Null(typeInfo.Type); 1736Assert.Null(typeInfo.Type); 1786Assert.Null(typeInfo.Type); 1836Assert.Null(typeInfo.Type); 1886Assert.Null(typeInfo.Type); 1936Assert.Null(typeInfo.Type); 1982Assert.Null(typeInfo.Type); 2030Assert.Null(typeInfo.Type); 2084Assert.Null(typeInfo.Type); 2149Assert.Null(typeInfo.Type); 2211Assert.Null(typeInfo.Type); 2270Assert.Null(typeInfo.Type); 2319Assert.Null(typeInfo.Type); 2358Assert.Null(typeInfo.Type); 2401Assert.Null(typeInfo.Type); 2453Assert.Null(typeInfo.Type); 2494Assert.Null(typeInfo.Type); 2542Assert.Null(typeInfo.Type); 2594Assert.Null(typeInfo.Type); 2640Assert.Null(typeInfo.Type); 2688Assert.Null(typeInfo.Type); 2735Assert.Null(typeInfo.Type); 3564Assert.Null(typeInfo1.Type); 3571Assert.Null(typeInfo2.Type); 3609Assert.Null(typeInfo.Type); 8030Assert.Null(typeInfo.Type); 8053Assert.Equal("System.Action", typeInfo.Type.ToTestDisplayString()); 8059Assert.True(HaveMatchingSignatures(((INamedTypeSymbol)typeInfo.Type!).DelegateInvokeMethod!, method)); 10399return (symbol?.ToTestDisplayString(), typeInfo.Type?.ToTestDisplayString(), typeInfo.ConvertedType?.ToTestDisplayString()); 12122var type = model!.GetTypeInfo(expr).Type; 14369var type = (INamedTypeSymbol)model.GetTypeInfo(variable).Type!; 19765Assert.Equal("System.Func<?>[]", typeInfo.Type.ToTestDisplayString()); 19769Assert.Null(typeInfo.Type); 19807Assert.Equal("?[]", typeInfo.Type.ToTestDisplayString()); 19811Assert.Null(typeInfo.Type);
Semantics\DynamicTests.cs (305)
4982AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 4990AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5063AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5106AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5114AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5186AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5229AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5237AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5310AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5351Assert.True(typeInfo.Type.IsErrorType()); 5392AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5436AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5480AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5524AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5701AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5742AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5787AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5832AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 5877AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6028AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6035AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6108AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6151AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6158AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6231AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6271AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6278AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6351AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6386AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6428AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6432Assert.Equal(typeInfo.Type, propertyRef.Type); 6475AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6479Assert.Equal(typeInfo.Type, propertyRef.Type); 6519AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6523Assert.Equal(typeInfo.Type, propertyRef.Type); 6564AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6568Assert.Equal(typeInfo.Type, propertyRef.Type); 6573AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6618AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6622Assert.Equal(typeInfo.Type, propertyRef.Type); 6677AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6684AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6688Assert.Equal(typeInfo.Type, propertyRef.Type); 6692AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6702AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 6740AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 6786AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6793AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6797Assert.Equal(typeInfo.Type, propertyRef.Type); 6801AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6811AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 6849AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 6896AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6903AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6907Assert.Equal(typeInfo.Type, propertyRef.Type); 6911AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6921AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 6960AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 7000AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7004Assert.Equal(typeInfo.Type, propertyRef.Type); 7008AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7018AssertEx.Equal("System.Object", typeInfo.Type.ToTestDisplayString()); 7065AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7072AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7076Assert.Equal(typeInfo.Type, propertyRef.Type); 7080AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7085AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 7122AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 7168AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7175AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7179Assert.Equal(typeInfo.Type, propertyRef.Type); 7183AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7196AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 7234AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7281AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7288AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7292Assert.Equal(typeInfo.Type, propertyRef.Type); 7296AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7309AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 7350AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7397AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7404AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7408Assert.Equal(typeInfo.Type, propertyRef.Type); 7412AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7425AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7467AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7510AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7511Assert.False(typeInfo.Type.IsErrorType()); 7517AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7521Assert.Equal(typeInfo.Type, propertyRef.Type); 7525AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7526Assert.False(typeInfo.Type.IsErrorType()); 7540AssertEx.Equal("C2", typeInfo.Type.ToTestDisplayString()); 7587AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7594AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7598Assert.Equal(typeInfo.Type, propertyRef.Type); 7602AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7609AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 7646AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7692AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7699AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7703Assert.Equal(typeInfo.Type, propertyRef.Type); 7707AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7752AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7798AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7805AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7809Assert.Equal(typeInfo.Type, propertyRef.Type); 7813AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7858AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7901AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7902Assert.False(typeInfo.Type.IsErrorType()); 7909AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7913Assert.Equal(typeInfo.Type, propertyRef.Type); 7917AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7918Assert.False(typeInfo.Type.IsErrorType()); 7919Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 7973AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7980AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 7984Assert.Equal(typeInfo.Type, propertyRef.Type); 7988AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8033AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8079AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8086AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8090Assert.Equal(typeInfo.Type, propertyRef.Type); 8094AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8139AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8184AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8191AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8195Assert.Equal(typeInfo.Type, propertyRef.Type); 8199AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8243AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8289AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8296AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8300Assert.Equal(typeInfo.Type, propertyRef.Type); 8304AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8314AssertEx.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 8352AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 8398AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8405AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8409Assert.Equal(typeInfo.Type, propertyRef.Type); 8413AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8423AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 8461AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 8507AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8514AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8518Assert.Equal(typeInfo.Type, propertyRef.Type); 8522AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8532AssertEx.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 8570AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 8617AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8624AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8628Assert.Equal(typeInfo.Type, propertyRef.Type); 8632AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8642AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8681AssertEx.Equal("dynamic?", typeInfo.Type.ToTestDisplayString()); 8733AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8737Assert.Equal(typeInfo.Type, propertyRef.Type); 8741AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8751AssertEx.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 8802AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8806Assert.Equal(typeInfo.Type, propertyRef.Type); 8810AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8820AssertEx.Equal("C2", typeInfo.Type.ToTestDisplayString()); 8867AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8874AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8878Assert.Equal(typeInfo.Type, propertyRef.Type); 8882AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8892AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 8930AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8934Assert.Equal(typeInfo.Type, propertyRef.Type); 8938AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 8948AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 9020AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9024Assert.Equal(typeInfo.Type, propertyRef.Type); 9028AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9038AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 9111AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9115Assert.Equal(typeInfo.Type, propertyRef.Type); 9119AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9129AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9201AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9205Assert.Equal(typeInfo.Type, propertyRef.Type); 9209AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9219AssertEx.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 9257AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9261Assert.Equal(typeInfo.Type, propertyRef.Type); 9265AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9275AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 9318AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9322Assert.Equal(typeInfo.Type, propertyRef.Type); 9326AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9439AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9443Assert.Equal(typeInfo.Type, propertyRef.Type); 9447AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9559AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9563Assert.Equal(typeInfo.Type, propertyRef.Type); 9567AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9673AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9677Assert.Equal(typeInfo.Type, propertyRef.Type); 9681AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9784AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9788Assert.Equal(typeInfo.Type, propertyRef.Type); 9792AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9895AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 9899Assert.Equal(typeInfo.Type, propertyRef.Type); 9903AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10019AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10026AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10030Assert.Equal(typeInfo.Type, propertyRef.Type); 10034AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 10039AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10045Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10046Assert.Equal(tupleTypeInfo.Type, operation.Value.Type); 10047Assert.Equal(typeInfo.Type, operation.Type); 10051AssertEx.Equal("(System.Int32, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10056AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 10096AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10147AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10154AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10158Assert.Equal(typeInfo.Type, propertyRef.Type); 10162AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 10167AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10173Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10174Assert.Equal(tupleTypeInfo.Type, operation.Value.Type); 10175Assert.Equal(typeInfo.Type, operation.Type); 10179AssertEx.Equal("(System.Int32, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10184AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 10224AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10275AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10282AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10286Assert.Equal(typeInfo.Type, propertyRef.Type); 10290AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 10295AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10301Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10302Assert.Equal(tupleTypeInfo.Type, operation.Value.Type); 10303Assert.Equal(typeInfo.Type, operation.Type); 10307AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10312AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10352AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10429AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10436AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10440Assert.Equal(typeInfo.Type, propertyRef.Type); 10444AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 10449AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10455Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10456Assert.Equal(tupleTypeInfo.Type, operation.Value.Type); 10457Assert.Equal(typeInfo.Type, operation.Type); 10461AssertEx.Equal("(System.Int32, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10466AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 10504AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10563AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10570AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10574Assert.Equal(typeInfo.Type, propertyRef.Type); 10578AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 10583AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10589Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10591Assert.Equal(typeInfo.Type, operation.Type); 10595AssertEx.Equal("C2", typeInfo.Type.ToTestDisplayString()); 10651AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10711AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10718AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10722Assert.Equal(typeInfo.Type, propertyRef.Type); 10726AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 10731AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 10737Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 10739Assert.Equal(typeInfo.Type, operation.Type); 10743AssertEx.Equal("C2", typeInfo.Type.ToTestDisplayString()); 10801AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10981AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10988AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 10992Assert.Equal(typeInfo.Type, propertyRef.Type); 10996AssertEx.Equal("(dynamic, System.Int32)", tupleTypeInfo.Type.ToTestDisplayString()); 11001AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11007Assert.Equal(tupleTypeInfo.Type, operation.Target.Type); 11009Assert.Equal(typeInfo.Type, operation.Type); 11013AssertEx.Equal("C2", typeInfo.Type.ToTestDisplayString()); 11067AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11109AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11114AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11119AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.Type.ToTestDisplayString()); 11124AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.Type.ToTestDisplayString()); 11131AssertEx.Equal("((System.Int32, System.Int32), System.Int32)", typeInfo.Type.ToTestDisplayString()); 11136AssertEx.Equal("(System.Int32, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11141AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 11193AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11198AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11203AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.Type.ToTestDisplayString()); 11208AssertEx.Equal("((dynamic, System.Int32), System.Int32)", typeInfo.Type.ToTestDisplayString()); 11215AssertEx.Equal("(C2, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11220AssertEx.Equal("C2", typeInfo.Type.ToTestDisplayString()); 11271AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11276AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11281AssertEx.Equal("(dynamic, System.Int32)", typeInfo.Type.ToTestDisplayString()); 11323AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11331AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11376AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11384AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11460AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11504AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11545AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11590AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11597AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11642AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11649AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString()); 11689AssertEx.Equal("dynamic", typeInfo.Type.ToTestDisplayString());
Semantics\ExpressionBodiedMemberTests.cs (2)
431Assert.Equal(typeInfo1.Type, typeInfo2.Type);
Semantics\ForEachTests.cs (2)
2144Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 2145Assert.Equal(typeInfo.Type, typeInfo.ConvertedType);
Semantics\FunctionPointerTests.cs (18)
212Assert.Equal(TypeKind.FunctionPointer, typeInfo.Type!.TypeKind); 218var classifiedConversion = comp.ClassifyConversion(typeInfo.Type, typeInfo.ConvertedType!); 297Assert.Null(typeInfo.Type); 355var conversion = model.ClassifyConversion(conversions[0].Expression, typeInfoOuter.Type!); 361conversion = model.ClassifyConversion(conversions[1].Expression, typeInfoOuter.Type!); 406var conversion = model.ClassifyConversion(conversions[0].Expression, typeInfoOuter.Type!); 410conversion = model.ClassifyConversion(conversions[1].Expression, typeInfoOuter.Type!); 458var conversion = model.ClassifyConversion(conversions[0].Expression, typeInfoOuter.Type!); 508var conversion = model.ClassifyConversion(conv.Expression, typeInfoOuter.Type!); 609var classifiedConversion = comp.ClassifyConversion(typeInfo.Type!, typeInfo.ConvertedType!); 850var classifiedConversion = comp.ClassifyConversion(typeInfo.Type!, typeInfo.ConvertedType!); 907AssertEx.Equal(expectedOriginalType, typeInfo.Type!.ToTestDisplayString()); 909var classifiedConversion = comp.ClassifyConversion(typeInfo.Type!, typeInfo.ConvertedType!); 2095AssertEx.Equal("delegate* unmanaged<System.Int32>", typeInfo.Type.ToTestDisplayString()); 2432.Select(s => model.GetTypeInfo(s).Type.ToTestDisplayString()) 2500.Select(s => model.GetTypeInfo(s).Type.ToTestDisplayString()) 2597.Select(s => model.GetTypeInfo(s).Type.ToTestDisplayString()) 2670.Select(s => model.GetTypeInfo(s).Type.ToTestDisplayString())
Semantics\GlobalUsingDirectiveTests.cs (7)
4245Assert.Equal("C1", model.GetTypeInfo(node).Type.ToTestDisplayString()); 4253Assert.Equal("C1", model.GetTypeInfo(node).Type.ToTestDisplayString()); 4281Assert.Equal("C1", model.GetTypeInfo(node).Type.ToTestDisplayString()); 4289Assert.Equal("C1", model.GetTypeInfo(node).Type.ToTestDisplayString()); 4297Assert.Equal("C1", model.GetTypeInfo(node).Type.ToTestDisplayString()); 4305Assert.Equal("C1", model.GetTypeInfo(node).Type.ToTestDisplayString()); 4317Assert.Equal("C3", model.GetTypeInfo(node).Type.ToTestDisplayString());
Semantics\ImplicitlyTypeArraysTests.cs (2)
72Assert.NotNull(info.Type); 100Assert.NotNull(typeInfo.Type);
Semantics\ImplicitObjectCreationTests.cs (26)
65Assert.Equal(type, model.GetTypeInfo(@new).Type.ToTestDisplayString()); 140Assert.Equal(type, model.GetTypeInfo(@new).Type.ToTestDisplayString()); 187Assert.Equal(type, model.GetTypeInfo(@new).Type.ToTestDisplayString()); 239Assert.Equal(type, model.GetTypeInfo(@new).Type.ToTestDisplayString()); 845Assert.Equal("InterfaceType", model.GetTypeInfo(@new).Type.ToTestDisplayString()); 886Assert.Equal("NonGenericInterfaceType", model.GetTypeInfo(@new).Type.ToTestDisplayString()); 1715Assert.Equal(type, model.GetTypeInfo(invocation).Type.ToTestDisplayString()); 1869Assert.Equal("C", model.GetTypeInfo(def).Type.ToTestDisplayString()); 1899Assert.Equal("S", model.GetTypeInfo(def).Type.ToTestDisplayString()); 1929Assert.Equal("S", model.GetTypeInfo(def).Type.ToTestDisplayString()); 1982Assert.Equal("S", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2040Assert.Equal("System.Object", model.GetTypeInfo(@new).Type.ToTestDisplayString()); 2047Assert.Equal("System.Object", model.GetTypeInfo(newObject).Type.ToTestDisplayString()); 2075Assert.Equal("System.Object", model.GetTypeInfo(@new).Type.ToTestDisplayString()); 2082Assert.Equal("System.Object", model.GetTypeInfo(newObject).Type.ToTestDisplayString()); 2134Assert.Equal(type, model.GetTypeInfo(@new).Type.ToTestDisplayString()); 2221Assert.Equal("T", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2517Assert.Equal("System.Exception", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2569Assert.Equal("C", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2932Assert.Equal(type, model.GetTypeInfo(@new).Type.ToTestDisplayString()); 3219Assert.Equal("System.Object[]", model.GetTypeInfo(first).Type.ToTestDisplayString()); 3223Assert.Equal("System.Object", model.GetTypeInfo(second).Type.ToTestDisplayString()); 3227Assert.Equal("C[]", model.GetTypeInfo(third).Type.ToTestDisplayString()); 3231Assert.Equal("C", model.GetTypeInfo(fourth).Type.ToTestDisplayString()); 4162Assert.Null(typeInfo.Type); 4199Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString());
Semantics\IndexAndRangeTests.cs (30)
899Assert.Equal("System.Index", model.GetTypeInfo(expression).Type.ToTestDisplayString()); 920Assert.Equal("System.Index", model.GetTypeInfo(expression).Type.ToTestDisplayString()); 941Assert.Equal("System.Index?", model.GetTypeInfo(expression).Type.ToTestDisplayString()); 1125Assert.Equal("System.Range", model.GetTypeInfo(expressions[0]).Type.ToTestDisplayString()); 1127Assert.Equal("System.Int32", model.GetTypeInfo(expressions[0].RightOperand).Type.ToTestDisplayString()); 1128Assert.Equal("System.Int32", model.GetTypeInfo(expressions[0].LeftOperand).Type.ToTestDisplayString()); 1130Assert.Equal("System.Range", model.GetTypeInfo(expressions[1]).Type.ToTestDisplayString()); 1133Assert.Equal("System.Int32", model.GetTypeInfo(expressions[1].LeftOperand).Type.ToTestDisplayString()); 1135Assert.Equal("System.Range", model.GetTypeInfo(expressions[2]).Type.ToTestDisplayString()); 1137Assert.Equal("System.Int32", model.GetTypeInfo(expressions[2].RightOperand).Type.ToTestDisplayString()); 1140Assert.Equal("System.Range", model.GetTypeInfo(expressions[3]).Type.ToTestDisplayString()); 1252Assert.Equal("System.Range", model.GetTypeInfo(expression).Type.ToTestDisplayString()); 1285Assert.Equal("System.Range", model.GetTypeInfo(expression).Type.ToTestDisplayString()); 1318Assert.Equal("System.Range", model.GetTypeInfo(expression).Type.ToTestDisplayString()); 1344Assert.Equal("System.Range", model.GetTypeInfo(expressions[0]).Type.ToTestDisplayString()); 1346Assert.Equal("System.Index", model.GetTypeInfo(expressions[0].RightOperand).Type.ToTestDisplayString()); 1347Assert.Equal("System.Index", model.GetTypeInfo(expressions[0].LeftOperand).Type.ToTestDisplayString()); 1349Assert.Equal("System.Range", model.GetTypeInfo(expressions[1]).Type.ToTestDisplayString()); 1352Assert.Equal("System.Index", model.GetTypeInfo(expressions[1].LeftOperand).Type.ToTestDisplayString()); 1354Assert.Equal("System.Range", model.GetTypeInfo(expressions[2]).Type.ToTestDisplayString()); 1356Assert.Equal("System.Index", model.GetTypeInfo(expressions[2].RightOperand).Type.ToTestDisplayString()); 1359Assert.Equal("System.Range", model.GetTypeInfo(expressions[3]).Type.ToTestDisplayString()); 1387Assert.Equal("System.Range?", model.GetTypeInfo(expressions[0]).Type.ToTestDisplayString()); 1389Assert.Equal("System.Index?", model.GetTypeInfo(expressions[0].RightOperand).Type.ToTestDisplayString()); 1390Assert.Equal("System.Index?", model.GetTypeInfo(expressions[0].LeftOperand).Type.ToTestDisplayString()); 1392Assert.Equal("System.Range?", model.GetTypeInfo(expressions[1]).Type.ToTestDisplayString()); 1395Assert.Equal("System.Index?", model.GetTypeInfo(expressions[1].LeftOperand).Type.ToTestDisplayString()); 1397Assert.Equal("System.Range?", model.GetTypeInfo(expressions[2]).Type.ToTestDisplayString()); 1399Assert.Equal("System.Index?", model.GetTypeInfo(expressions[2].RightOperand).Type.ToTestDisplayString()); 1402Assert.Equal("System.Range", model.GetTypeInfo(expressions[3]).Type.ToTestDisplayString());
Semantics\InitOnlyMemberTests.cs (1)
3166Assert.Equal("Int32", typeSpeculation.Type.Name);
Semantics\InteractiveUsingTests.cs (1)
597SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
Semantics\IteratorTests.cs (5)
466Assert.Equal(TypeKind.Error, typeInfo.Type.TypeKind); 618Assert.Equal("System.Collections.Generic.KeyValuePair<TKey, TValue>", typeInfo.Type.ToTestDisplayString()); 619Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 656Assert.Equal("System.Collections.Generic.KeyValuePair<TKey, TValue>", typeInfo.Type.ToTestDisplayString()); 657Assert.Equal(typeInfo.Type, typeInfo.ConvertedType);
Semantics\LambdaTests.cs (50)
847Assert.Equal("int", tinfo.Type.ToDisplayString()); 854Assert.Null(tinfo.Type); 864Assert.Null(tinfo.Type); 1040Assert.NotNull(((ITypeSymbol)typeInfo.Type).GetMember("String")); 1094Assert.NotNull(((ITypeSymbol)typeInfo.Type).GetMember("SomeProperty")); 2124Assert.Equal("MyArgumentType", typeInfo.Type.Name); 2125Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2126Assert.NotEmpty(typeInfo.Type.GetMembers("SomePublicMember")); 2170Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2171Assert.Equal("String", typeInfo.Type.Name); 2172Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2216Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2217Assert.Equal("String", typeInfo.Type.Name); 2218Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2262Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2263Assert.Equal("String", typeInfo.Type.Name); 2264Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2308Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2309Assert.Equal("String", typeInfo.Type.Name); 2310Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2338Assert.Equal(TypeKind.Struct, typeInfo.Type.TypeKind); 2339Assert.Equal("Char", typeInfo.Type.Name); 2340Assert.NotEmpty(typeInfo.Type.GetMembers("IsHighSurrogate")); // check it is the char we know and love 2365Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2366Assert.Equal("String", typeInfo.Type.Name); 2367Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2420Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2421Assert.Equal("String", typeInfo.Type.Name); 2422Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2466Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2467Assert.Equal("String", typeInfo.Type.Name); 2468Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2512Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2513Assert.Equal("String", typeInfo.Type.Name); 2514Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2545Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2546Assert.Equal("String", typeInfo.Type.Name); 2547Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2578Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2579Assert.Equal("String", typeInfo.Type.Name); 2580Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 2615Assert.Equal(TypeKind.Class, typeInfo.Type.TypeKind); 2616Assert.Equal("String", typeInfo.Type.Name); 2617Assert.NotEmpty(typeInfo.Type.GetMembers("Replace")); 3002Assert.Equal(TypeKind.Error, model.GetTypeInfo(contentType).Type.TypeKind); 3011Assert.Equal(TypeKind.Error, model.GetTypeInfo(b).Type.TypeKind); 3949Assert.Equal(expectedAttributeType, typeInfo.Type); 5647Assert.Equal(expectedType, typeInfo.Type); 6517Assert.True(model.GetTypeInfo(parameterUsage).Type.IsErrorType()); 7013AssertEx.Equal("System.Action", model.GetTypeInfo(action).Type.ToTestDisplayString());
Semantics\LocalFunctionTests.cs (21)
457var argType0 = model.GetTypeInfo(attrArg0).Type; 463var argType1 = model.GetTypeInfo(attrArg1).Type; 620Assert.Equal(SpecialType.System_String, model.GetTypeInfo(arg1.Expression).Type.SpecialType); 624Assert.Equal(SpecialType.System_String, model.GetTypeInfo(arg2.Expression).Type.SpecialType); 628Assert.Equal(SpecialType.System_String, model.GetTypeInfo(arg3.Expression).Type.SpecialType); 673Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(arg.Expression).Type.SpecialType); 727Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(arg.Expression).Type.SpecialType); 1779Assert.Equal(TypeKind.Error, aTypeInfo.Type.TypeKind); 1802Assert.Equal(clsCompliantSymbol, model.GetTypeInfo(clsCompliant).Type); 1854Assert.Equal(TypeKind.Error, aTypeInfo.Type.TypeKind); 1877Assert.Equal(clsCompliantSymbol, model.GetTypeInfo(clsCompliant).Type); 7435Assert.Equal("System.String", parentModel.GetSpeculativeTypeInfo(aPosition, newNameOf, SpeculativeBindingOption.BindAsExpression).Type.ToTestDisplayString()); 7439Assert.Equal("TParameter", parentModel.GetSpeculativeTypeInfo(bPosition, newNameOfArgument, SpeculativeBindingOption.BindAsExpression).Type.ToTestDisplayString()); 7442Assert.Equal("System.String", parentModel.GetSpeculativeTypeInfo(cPosition, newNameOf, SpeculativeBindingOption.BindAsExpression).Type.ToTestDisplayString()); 7445Assert.Equal("TParameter", parentModel.GetSpeculativeTypeInfo(dPosition, newNameOfArgument, SpeculativeBindingOption.BindAsExpression).Type.ToTestDisplayString()); 7656Assert.Equal(SymbolKind.TypeParameter, typeInfo.Type.Kind); 7660Assert.True(typeInfo.Type.IsErrorType()); 7668Assert.Equal(symbolKind, model.GetTypeInfo(tParameterUsage).Type.Kind); 8695Assert.True(model.GetTypeInfo(parameterUsage).Type.IsErrorType()); 8701Assert.Equal("System.Int32", model.GetTypeInfo(parameterUsage).Type.ToTestDisplayString()); 10430Assert.Equal("System.Int32", model.GetTypeInfo(p).Type.ToTestDisplayString());
Semantics\LockTests.cs (4)
492Assert.Null(model.GetTypeInfo(lockStatements[0].Expression).Type); 578Assert.Equal(@"System.Collections.Generic.IEnumerable<char>", model.GetTypeInfo(lockStatements[0].Expression).Type.ToDisplayString()); 711Assert.NotNull(typeInfo.Type); 714Assert.Equal(symbol, typeInfo.Type.GetSymbol());
Semantics\LookupTests.cs (1)
690var baseExprType = (INamedTypeSymbol)baseExprInfo.Type;
Semantics\MethodTypeInferenceTests.cs (7)
842Assert.Null(model.GetTypeInfo(discard).Type); 845Assert.Equal(type, model.GetTypeInfo(declaration).Type.ToTestDisplayString(includeNonNullable: true)); 854Assert.Equal(type, model.GetTypeInfo(discard).Type.ToTestDisplayString(includeNonNullable: true)); 1120var bookType = model.GetTypeInfo(book).Type; 1161var authorType = model.GetTypeInfo(author).Type; 1202var bookResultType = model.GetTypeInfo(bookResult).Type; 1206var authorResultType = model.GetTypeInfo(authorResult).Type;
Semantics\NamedAndOptionalTests.cs (1)
815Assert.Null(typeInfo.Type);
Semantics\NativeIntegerTests.cs (3)
4077var type = model.GetSpeculativeTypeInfo(spanStart, typeSyntax, SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 4122var type = model.GetTypeInfo(node).Type; 9506Assert.Equal(sourceType, typeInfo.Type.ToString());
Semantics\NullableReferenceTypesTests.cs (21)
10538Assert.Equal("System.String!", model.GetTypeInfo(type1).Type.ToTestDisplayString(includeNonNullable: true)); 10542Assert.Equal("System.String?", model.GetTypeInfo(type2).Type.ToTestDisplayString(includeNonNullable: true)); 13512AssertEx.Equal("S?[]", model.GetTypeInfo(returnStatement.Expression).Type.ToTestDisplayString()); 56078Assert.Null(model.GetTypeInfo(nullNode).Type); 56108Assert.Null(model.GetTypeInfo(nullNode).Type); 56113Assert.Equal("System.Object?[]", model.GetTypeInfo(invocationNode).Type.ToTestDisplayString()); 56141Assert.Equal("U?", model.GetTypeInfo(defaultNode).Type.ToTestDisplayString()); 56178Assert.Equal("U", model.GetTypeInfo(defaultNode).Type.ToTestDisplayString()); 56306Assert.Null(model.GetTypeInfo(nullNode).Type); 56439Assert.Equal("System.Object", model.GetTypeInfo(newNode).Type.ToTestDisplayString()); 56474Assert.Equal("Program", model.GetTypeInfo(newNode).Type.ToTestDisplayString()); 56510Assert.Null(model.GetTypeInfo(nullNode).Type); 56621Assert.Null(model.GetTypeInfo(lambdaNode).Type); 71927Assert.Equal("System.String", model.GetTypeInfo(discard1).Type.ToTestDisplayString()); 71964Assert.Equal("System.Object", model.GetTypeInfo(discardPattern1).Type.ToTestDisplayString()); 71971Assert.Equal("System.Object", model.GetTypeInfo(discardPattern2).Type.ToTestDisplayString()); 113196Assert.Equal("B[]", model.GetTypeInfo(arrays[0]).Type.ToTestDisplayString(includeNonNullable: true)); 113197Assert.Equal("C![]", model.GetTypeInfo(arrays[1]).Type.ToTestDisplayString(includeNonNullable: true)); 113806model.GetSpeculativeTypeInfo(decl.Identifier.SpanStart, type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type.ToTestDisplayString(includeNonNullable: true)); 114032model.GetTypeInfo(type).Type.ToTestDisplayString(includeNonNullable: true)); 160691Assert.Equal("System.Int64*", model.GetTypeInfo(stackallocNode).Type.ToTestDisplayString());
Semantics\NullCoalesceAssignmentTests.cs (10)
48Assert.NotNull(typeInfo.Type); 49Assert.Equal(cType.GetPublicSymbol(), typeInfo.Type); 83Assert.Equal(dType.GetPublicSymbol(), whenNullTypeInfo.Type); 90Assert.NotNull(typeInfo.Type); 91Assert.Equal(cType, typeInfo.Type.GetSymbol()); 123Assert.Equal(dType, whenNullTypeInfo.Type.GetSymbol()); 133Assert.NotNull(typeInfo.Type); 134Assert.Equal(dType.GetPublicSymbol(), typeInfo.Type); 161var coalesceType = semanticModel.GetTypeInfo(coalesceAssignment).Type; 186Assert.Equal(SpecialType.System_Int32, semanticModel.GetTypeInfo(defaultLiteral).Type.SpecialType);
Semantics\ObjectAndCollectionInitializerTests.cs (14)
3821Assert.Same(typeInfo.Type, typeInfo.ConvertedType); 3844Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 3868Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 4024Assert.Null(semanticModel.GetTypeInfo(name).Type); 4099Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 4171Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 4231AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4236Assert.Equal(typeInfo.Type, propertyRef.Type); 4240AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4250AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4285AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4290Assert.Equal(typeInfo.Type, propertyRef.Type); 4294AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 4304AssertEx.Equal("System.Int32", typeInfo.Type.ToTestDisplayString());
Semantics\OperatorTests.cs (6)
2987var type1 = model.GetTypeInfo(negOne).Type; 2993var type2 = model.GetTypeInfo(boolPlusPlus).Type; 2999var type3 = model.GetTypeInfo(errorPlusPlus).Type; 7060Assert.Equal(comp.GlobalNamespace.GetMember<NamedTypeSymbol>("InputParameter"), info.Type.GetSymbol()); 7215Assert.Equal(comp.GlobalNamespace.GetMember<NamedTypeSymbol>("InputParameter").GetPublicSymbol(), info.Type); 11340var type = (ITypeSymbol)compilation.GetSemanticModel(tree).GetTypeInfo(negNode).Type;
Semantics\QueryTests.cs (8)
2301Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 3141Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind); 3382Assert.NotEqual(TypeKind.Error, typeInfo2.Type.TypeKind); 3383Assert.Equal("Assembly", typeInfo2.Type.Name); 3391Assert.NotEqual(TypeKind.Error, typeInfo1.Type.TypeKind); 3392Assert.Equal("Assembly", typeInfo1.Type.Name); 3484Assert.NotNull(selectClauseTypeInfo.Type); 3485Assert.Equal("List1", selectClauseTypeInfo.Type.Name);
Semantics\RecordStructTests.cs (3)
535var type = model.GetTypeInfo(creation).Type!; 6927Assert.Equal("B", type.Type.ToTestDisplayString()); 7608Assert.Equal("T", type.Type.ToTestDisplayString());
Semantics\RefEscapingTests.cs (8)
5720Assert.Equal("(System.Span<int> local, string)", model.GetTypeInfo(tuple2).Type.ToString()); 5726Assert.Null(model.GetTypeInfo(tuple3).Type); 5732Assert.Equal("(System.Span<int> local, string)", model.GetTypeInfo(tuple6).Type.ToString()); 5738Assert.Null(model.GetTypeInfo(tuple7).Type); 5820Assert.Equal("(System.Span<int> local, string)", model.GetTypeInfo(tuple2).Type.ToString()); 5826Assert.Null(model.GetTypeInfo(tuple3).Type); 5832Assert.Equal("(System.Span<int> local, string)", model.GetTypeInfo(tuple6).Type.ToString()); 5838Assert.Null(model.GetTypeInfo(tuple7).Type);
Semantics\RefFieldTests.cs (76)
12080Assert.Null(model.GetTypeInfo(type).Type); 12087Assert.Null(model.GetTypeInfo(type).Type); 12093Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12144Assert.Null(model.GetTypeInfo(type).Type); 12151Assert.Null(model.GetTypeInfo(type).Type); 12157Assert.Equal("Script.R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12214Assert.Null(model.GetTypeInfo(type).Type); 12221Assert.Null(model.GetTypeInfo(type).Type); 12227Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12403Assert.Null(model.GetTypeInfo(type).Type); 12410Assert.Null(model.GetTypeInfo(type).Type); 12416Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12426Assert.Null(model.GetTypeInfo(decl).Type); 12435Assert.Null(model.GetTypeInfo(type).Type); 12442Assert.Null(model.GetTypeInfo(type).Type); 12448Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12583Assert.Null(model.GetTypeInfo(type).Type); 12590Assert.Null(model.GetTypeInfo(type).Type); 12596Assert.Equal("Script.R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12606Assert.Null(model.GetTypeInfo(decl).Type); 12611Assert.Null(model.GetTypeInfo(type).Type); 12618Assert.Null(model.GetTypeInfo(type).Type); 12624Assert.Equal("Script.R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12814Assert.Null(model.GetTypeInfo(type).Type); 12821Assert.Null(model.GetTypeInfo(type).Type); 12827Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12839Assert.Null(model.GetTypeInfo(decl).Type); 12848Assert.Null(model.GetTypeInfo(type).Type); 12855Assert.Null(model.GetTypeInfo(type).Type); 12861Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 12990Assert.Null(model.GetTypeInfo(type).Type); 12997Assert.Null(model.GetTypeInfo(type).Type); 13003Assert.Equal("Script.R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 13013Assert.Null(model.GetTypeInfo(decl).Type); 13018Assert.Null(model.GetTypeInfo(type).Type); 13025Assert.Null(model.GetTypeInfo(type).Type); 13031Assert.Equal("Script.R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 13456Assert.Null(model.GetTypeInfo(type).Type); 13463Assert.Null(model.GetTypeInfo(type).Type); 13469Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 13520Assert.Null(model.GetTypeInfo(type).Type); 13527Assert.Null(model.GetTypeInfo(type).Type); 13533Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 13597Assert.Null(model.GetTypeInfo(type).Type); 13604Assert.Null(model.GetTypeInfo(type).Type); 13610Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 13667Assert.Null(model.GetTypeInfo(type).Type); 13674Assert.Null(model.GetTypeInfo(type).Type); 13680Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 14362Assert.Null(model.GetTypeInfo(type).Type); 14404Assert.Null(model.GetTypeInfo(type).Type); 14614Assert.Null(model.GetTypeInfo(type).Type); 14621Assert.Null(model.GetTypeInfo(type).Type); 14627Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 14858Assert.Null(model.GetTypeInfo(type).Type); 14865Assert.Null(model.GetTypeInfo(type).Type); 14871Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 14881Assert.Null(model.GetTypeInfo(decl).Type); 14886Assert.Null(model.GetTypeInfo(type).Type); 14893Assert.Null(model.GetTypeInfo(type).Type); 14899Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 15149Assert.Null(model.GetTypeInfo(type).Type); 15156Assert.Null(model.GetTypeInfo(type).Type); 15162Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 27063Assert.Null(model.GetTypeInfo(type).Type); 27070Assert.Null(model.GetTypeInfo(type).Type); 27076Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 27153Assert.Null(model.GetTypeInfo(type).Type); 27160Assert.Null(model.GetTypeInfo(type).Type); 27166Assert.Equal("R", model.GetTypeInfo(type).Type.ToTestDisplayString()); 27420Assert.Null(model.GetTypeInfo(type).Type); 27425Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 27480Assert.Null(model.GetTypeInfo(type).Type); 27485Assert.Equal("R<System.Int32>", model.GetTypeInfo(type).Type.ToTestDisplayString()); 27700Assert.Null(model.GetTypeInfo(type).Type); 27748Assert.Null(model.GetTypeInfo(type).Type);
Semantics\RefLocalsAndReturnsTests.cs (16)
4755Assert.Equal(SpecialType.System_Int32, ((IArrayTypeSymbol)model.GetTypeInfo(left).Type).ElementType.SpecialType); 4758Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4783Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)model.GetTypeInfo(left).Type).PointedAtType.SpecialType); 4786Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4811Assert.Equal(SpecialType.System_Int32, ((IPointerTypeSymbol)model.GetTypeInfo(left).Type).PointedAtType.SpecialType); 4814Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4839Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(left).Type.SpecialType); 4842Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4867Assert.Equal(SymbolKind.DynamicType, model.GetTypeInfo(left).Type.Kind); 4870Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4895Assert.Equal(SymbolKind.DynamicType, model.GetTypeInfo(left).Type.Kind); 4898Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 4929Assert.Equal(SpecialType.System_Object, model.GetTypeInfo(left).Type.SpecialType); 4932Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(right).Type.SpecialType); 5219Assert.Null(model.GetTypeInfo(type).Type); 5225Assert.Equal("System.Int32", model.GetTypeInfo(type).Type.ToTestDisplayString());
Semantics\SuppressAccessibilityChecksTests.cs (7)
57Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 62Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 77semanticModel.GetSpeculativeTypeInfo(position, exp, SpeculativeBindingOption.BindAsExpression).Type.Name); 98Assert.Equal("A", creationExpression.Type.Name); 171Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 177Assert.Equal("Int32", semanticModel.GetSpeculativeTypeInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Type.Name); 241Assert.Equal("Int32", typeSpeculation.Type.Name);
Semantics\TargetTypedConditionalOperatorTests.cs (5)
346var actualType = model.GetTypeInfo(conditionalExpr).Type; 355Assert.Equal(naturalType, model.GetTypeInfo(conditionalExpr).Type.ToTestDisplayString(includeNonNullable: false)); 363Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(conditionalExpr.Condition).Type!.SpecialType); 670Assert.Equal("System.Object", typeInfo.Type.ToTestDisplayString()); 691Assert.Null(typeInfo.Type);
Semantics\TargetTypedDefaultTests.cs (44)
45Assert.Equal("System.Int32", model.GetTypeInfo(def).Type.ToTestDisplayString()); 145Assert.Equal("System.Int32", model.GetTypeInfo(def).Type.ToTestDisplayString()); 198Assert.Equal("S", model.GetTypeInfo(def).Type.ToTestDisplayString()); 246Assert.Equal("System.Object", model.GetTypeInfo(def).Type.ToTestDisplayString()); 255Assert.Null(model.GetTypeInfo(nullSyntax).Type); 283Assert.Equal("System.Object", model.GetTypeInfo(def).Type.ToTestDisplayString()); 292Assert.Null(model.GetTypeInfo(nullSyntax).Type); 328Assert.Equal("T", model.GetTypeInfo(default1).Type.ToTestDisplayString()); 334Assert.Equal("?", model.GetTypeInfo(default2).Type.ToTestDisplayString()); 522Assert.Equal("?", model.GetTypeInfo(def).Type.ToTestDisplayString()); 531Assert.Null(model.GetTypeInfo(nullSyntax).Type); 568Assert.Equal("?", model.GetTypeInfo(def).Type.ToTestDisplayString()); 577Assert.Null(model.GetTypeInfo(nullSyntax).Type); 611Assert.Equal("?", model.GetTypeInfo(def).Type.ToTestDisplayString()); 620Assert.Null(model.GetTypeInfo(nullSyntax).Type); 669Assert.Equal("T", model.GetTypeInfo(def).Type.ToTestDisplayString()); 750Assert.Equal("?", model.GetTypeInfo(def).Type.ToTestDisplayString()); 759Assert.Null(model.GetTypeInfo(nullSyntax).Type); 838Assert.Equal("S", model.GetTypeInfo(def).Type.ToTestDisplayString()); 867Assert.Equal("T", model.GetTypeInfo(def).Type.ToTestDisplayString()); 1144Assert.Equal("System.Int32", model.GetTypeInfo(def).Type.ToTestDisplayString()); 1633Assert.Equal("?", model.GetTypeInfo(defaultLiteral).Type.ToTestDisplayString()); 1743Assert.Null(model.GetTypeInfo(@default).Type); 1748Assert.Equal(semanticType, model.GetTypeInfo(@default).Type.ToTestDisplayString()); 1807Assert.Equal(semanticType, model.GetTypeInfo(@default).Type.ToTestDisplayString()); 1878Assert.Equal(semanticType, model.GetTypeInfo(@default).Type.ToTestDisplayString()); 1913Assert.Equal("S", model.GetTypeInfo(first).Type.ToTestDisplayString()); 2091Assert.Equal("?", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2335Assert.Equal("System.Object[]", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2416Assert.Equal("System.Object[]", model.GetTypeInfo(first).Type.ToTestDisplayString()); 2421Assert.Equal("System.Object", model.GetTypeInfo(second).Type.ToTestDisplayString()); 2426Assert.Equal("S[]", model.GetTypeInfo(third).Type.ToTestDisplayString()); 2431Assert.Equal("S", model.GetTypeInfo(fourth).Type.ToTestDisplayString()); 2459Assert.Equal("System.Int32", model.GetTypeInfo(def).Type.ToTestDisplayString()); 2486Assert.Null(typeInfo.Type); 3056Assert.Equal("System.Int32?", model.GetTypeInfo(def).Type.ToTestDisplayString()); 3346Assert.Equal("C", model.GetTypeInfo(def).Type.ToTestDisplayString()); 3385Assert.Equal("D", model.GetTypeInfo(def).Type.ToTestDisplayString()); 3516Assert.Equal("System.Int16", model.GetTypeInfo(def).Type.ToTestDisplayString()); 3526Assert.Equal("System.Int16", conversionTypeInfo.Type.ToTestDisplayString()); 3576Assert.Equal("System.Int32?", model.GetTypeInfo(default1).Type.ToTestDisplayString()); 3584Assert.Equal("System.Int32?", model.GetTypeInfo(default2).Type.ToTestDisplayString()); 3591Assert.Equal("System.Byte?", model.GetTypeInfo(default3).Type.ToTestDisplayString()); 3598Assert.Equal("System.Byte", model.GetTypeInfo(default4).Type.ToTestDisplayString());
Semantics\TopLevelStatementsTests.cs (8)
254Assert.Null(typeInfo.Type); 265Assert.Null(typeInfo.Type); 405Assert.Null(typeInfo.Type); 416Assert.Null(typeInfo.Type); 1410Assert.Equal("System.String", model2.GetTypeInfo(nameRef).Type.ToTestDisplayString()); 1428Assert.Equal("System.String", model2.GetTypeInfo(nameRef).Type.ToTestDisplayString()); 6236Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name); 6244Assert.Equal("A", semanticModel.GetTypeInfo(invocation).Type.Name);
Semantics\TypeOfTests.cs (1)
39Assert.Equal("C", typeInfo.Type.ToTestDisplayString());
Semantics\UnsafeTests.cs (14)
5384Select(syntax => model.GetTypeInfo(syntax).Type).All(type => type.GetSymbol().IsManagedTypeNoUseSiteDiagnostics)); 7266var type = typeInfo.Type; 7333var type = typeInfo.Type; 7339Assert.Equal("?*", typeInfo.Type.ToTestDisplayString()); 7340Assert.Equal(TypeKind.Pointer, typeInfo.Type.TypeKind); 7341Assert.Equal(TypeKind.Error, ((IPointerTypeSymbol)typeInfo.Type).PointedAtType.TypeKind); 7371var type = typeInfo.Type; 7377Assert.Equal("?*", typeInfo.Type.ToTestDisplayString()); 7378Assert.Equal(TypeKind.Pointer, typeInfo.Type.TypeKind); 7379Assert.Equal(TypeKind.Error, ((IPointerTypeSymbol)typeInfo.Type).PointedAtType.TypeKind); 7413var type = typeInfo.Type; 7544var type = typeInfo.Type; 8350Assert.Null(typeInfo.Type); 8386var type = typeInfo.Type;
Semantics\UsingStatementTests.cs (1)
1855Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(node).Type.SpecialType);
Semantics\Utf8StringsLiteralsTests.cs (13)
2976Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 3004Assert.Equal("System.Byte[]", typeInfo.Type.ToTestDisplayString()); 3032Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 3060Assert.Equal("System.Span<System.Byte>", typeInfo.Type.ToTestDisplayString()); 3088Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 3116Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.Type.ToTestDisplayString()); 3144Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.Type.ToTestDisplayString()); 3172Assert.Equal("System.Byte[]", typeInfo.Type.ToTestDisplayString()); 3200Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.Type.ToTestDisplayString()); 3228Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.Type.ToTestDisplayString()); 3256Assert.Equal("System.ReadOnlySpan<System.Byte>", typeInfo.Type.ToTestDisplayString()); 3284Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 3312Assert.Equal("System.ReadOnlySpan<System.Char>", typeInfo.Type.ToTestDisplayString());
SourceGeneration\SyntaxAwareGeneratorTests.cs (1)
796Assert.Same(dType, typeInfo.Type);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (186)
Compilation\GetSemanticInfoBrokenCodeTests.cs (2)
248Assert.Equal(comp.GetWellKnownType(WellKnownType.System_Type), info.Type); 271Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType);
Compilation\GetSemanticInfoTests.cs (43)
78Assert.Null(info.Type); 110Assert.Null(info.Type); 144Assert.Null(info.Type); 193Assert.Null(info.Type); 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)); 858Assert.Null(info.Type); 862Assert.NotNull(info.Type); 863var act2 = semanticModel.Compilation.ClassifyConversion(info.Type, info.ConvertedType); 2403Assert.NotNull(typeInfo.Type); 2404Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()); 2410Assert.Null(typeInfo.Type); 2414Assert.NotNull(typeInfo.Type); 2415Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()); 2420Assert.NotNull(typeInfo.Type); 2421Assert.Equal("System.Byte", typeInfo.Type.ToTestDisplayString()); 2426Assert.NotNull(typeInfo.Type); 2427Assert.Equal("System.Byte", typeInfo.Type.ToTestDisplayString()); 2458Assert.Equal(SpecialType.System_Double, info.Type.SpecialType); 2487Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2511Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 2732Assert.Equal(type, typeInfo.Type); 2803Assert.Equal(returnType, typeInfo.Type); 3474Assert.Equal("B", argTypeInfo.Type.ToTestDisplayString()); 3528Assert.Equal("B<A>", argTypeInfo.Type.ToTestDisplayString()); 3587Assert.Equal("System.IntPtr", argTypeInfo.Type.ToTestDisplayString()); 3611Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3636Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3644Assert.Equal(SpecialType.System_Int64, castTypeInfo.Type.SpecialType); 3669Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3677Assert.Equal(SpecialType.System_Object, castTypeInfo.Type.SpecialType); 3681Assert.Equal(ConversionKind.Boxing, model.ClassifyConversion(literal, castTypeInfo.Type).Kind); 3705Assert.Equal(SpecialType.System_Int32, literalTypeInfo.Type.SpecialType); 3713Assert.Equal(SpecialType.System_Int64, cast1TypeInfo.Type.SpecialType); 3718Assert.Equal(ConversionKind.ImplicitNumeric, model.ClassifyConversion(literal, cast1TypeInfo.Type).Kind); 3725Assert.Equal(SpecialType.System_Object, cast2TypeInfo.Type.SpecialType); 3729Assert.Equal(ConversionKind.Boxing, model.ClassifyConversion(cast1, cast2TypeInfo.Type).Kind); 4275Assert.NotNull(info.Type); 4381Assert.Equal(TypeKind.Enum, info.Type.TypeKind); 5526Assert.Null(typeInfo.Type); 5542Assert.Null(typeInfo.Type); 5916Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(expr).Type.SpecialType);
Compilation\SemanticModelAPITests.cs (68)
55Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 59Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 142Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType); 152Assert.Equal(SpecialType.System_Char, typeInfo.Type.SpecialType); 541Assert.Equal(a, model.GetTypeInfo(bbase).Type); 567Assert.Equal(b, model.GetTypeInfo(cbase).Type); 615Assert.Equal(at2, model.GetTypeInfo(bbase).Type); 931Assert.NotNull(type1.Type); 932Assert.Equal("System.Int32", type1.Type.ToTestDisplayString()); 933Assert.NotNull(type2.Type); 934Assert.Equal("System.Int32", type2.Type.ToTestDisplayString()); 1433Assert.NotNull(typeInfo.Type); 1434Assert.Equal("String", typeInfo.Type.Name); 1471Assert.NotNull(typeInfo.Type); 1472Assert.Equal("Int16", typeInfo.Type.Name); 1519Assert.NotNull(typeInfo.Type); 1520Assert.Equal("Int16", typeInfo.Type.Name); 1567Assert.NotNull(typeInfo.Type); 1568Assert.Equal("E", typeInfo.Type.Name); 1607Assert.NotNull(typeInfo.Type); 1608Assert.Equal("Int16", typeInfo.Type.Name); 1692Assert.NotNull(typeInfo.Type); 1693Assert.Equal("String", typeInfo.Type.Name); 1794Assert.NotNull(typeInfo.Type); 1795Assert.Equal("Int32", typeInfo.Type.Name); 2044Assert.Equal("Int32", typeInfo.Type.Name); 2276Assert.Equal("System.Int32*", typeInfo.Type.ToTestDisplayString()); 2277Assert.Equal(TypeKind.Pointer, typeInfo.Type.TypeKind); 2400Assert.NotNull(typeInfo.Type); 2401Assert.Equal("Int32", typeInfo.Type.Name); 2718var typeSymbol = speculativeModel.GetTypeInfo(speculatedTypeSyntax).Type; 2732typeSymbol = speculativeModel.GetTypeInfo(right).Type; 3031symbol = speculativeModel.GetTypeInfo(speculatedCref.Container).Type; 3059symbol = speculativeModel.GetTypeInfo(speculatedCref.Container).Type; 3166Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 3201Assert.Equal(SpecialType.System_Int32, info.Type.SpecialType); 3758Assert.Equal(stringType, identifierInfo.Type); 3916Assert.True(typeInfo0.Type != null && typeInfo0.Type.SpecialType == SpecialType.System_Int16); 3925Assert.True(typeInfo1.Type != null && typeInfo1.Type.Equals(type1)); 3932Assert.True(typeInfo2.Type != null && typeInfo2.Type.Equals(type2)); 4190Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[0]).Type.SpecialType); 4215Assert.Equal(SpecialType.System_Int32, model.GetTypeInfo(actual[0]).Type.SpecialType); 4219Assert.Equal(SpecialType.System_Boolean, model.GetTypeInfo(actual[1]).Type.SpecialType); 4243Assert.Null(model.GetTypeInfo(actual[0]).Type); 4280Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[0]).Type.SpecialType); 4284Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[1]).Type.SpecialType); 4287Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[2]).Type.SpecialType); 4291Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[3]).Type.SpecialType); 4295Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[4]).Type.SpecialType); 4299Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[5]).Type.SpecialType); 4303Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[6]).Type.SpecialType); 4307Assert.Equal(SpecialType.System_String, model.GetTypeInfo(actual[7]).Type.SpecialType); 4331Assert.Equal(TypeKind.Dynamic, dynamicType.Type.TypeKind); 4433Assert.Equal(SpecialType.System_Boolean, originalTypeInfo.Type.SpecialType); 4436Assert.Equal(SpecialType.System_Boolean, speculativeTypeInfo.Type.SpecialType); 4496Assert.NotNull(typeInfo.Type); 4498Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4500var type = (INamedTypeSymbol)typeInfo.Type; 4560Assert.NotNull(typeInfo.Type); 4562Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4564var type = (INamedTypeSymbol)typeInfo.Type; 4574Assert.NotNull(typeInfo.Type); 4576Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 4578var type = (INamedTypeSymbol)typeInfo.Type; 4762var type = model.GetTypeInfo(exprSyn).Type;
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
5663Assert.Equal(expectedType, type.Type.ToTestDisplayString());
Compilation\SemanticModelGetSemanticInfoTests.cs (7)
14743Assert.Equal("System.Int32", info1.Type.ToTestDisplayString()); 14806Assert.Null(typeInfo.Type); 14822Assert.Equal("Test.C", typeInfo.Type.ToTestDisplayString()); 14902Assert.Null(typeInfo.Type); 14918Assert.Equal("Test.I", typeInfo.Type.ToTestDisplayString()); 15013Assert.Null(typeInfo.Type); 15028Assert.Equal("Test.I", typeInfo.Type.ToTestDisplayString());
SymbolDisplay\SymbolDisplayTests.cs (2)
8228var type = semanticModel.GetTypeInfo(declaration.Declaration.Type).Type; 8279var type = semanticModel.GetTypeInfo(declaration.Declaration.Type).Type;
Symbols\AnonymousTypesSymbolTests.cs (3)
1480Assert.NotNull(info1.Type); 1649Assert.NotNull(info.Type); 1650var mems = info.Type.GetMembers();
Symbols\CorLibrary\CorTypes.cs (2)
297Assert.Equal(InternalSpecialType.System_Type, model.GetTypeInfo(node).Type.GetSymbol().ExtendedSpecialType); 362Assert.Equal((ExtendedSpecialType)0, model.GetTypeInfo(node).Type.GetSymbol().ExtendedSpecialType);
Symbols\CovariantReturnTests.cs (4)
386Assert.Equal(typeInfo.Type, typeInfo.ConvertedType); 2632Assert.Null(typeInfo.Type); 2636Assert.Null(typeInfo.Type); 2640Assert.Equal(typeInfo.Type, typeInfo.ConvertedType);
Symbols\ExtensionMethodTests.cs (5)
3781var type = model.GetTypeInfo(member.Expression).Type; 3868var baseClass = model.GetTypeInfo(instance).Type; 3915var baseClass = model.GetTypeInfo(instance).Type; 3960var baseClass = model.GetTypeInfo(instance).Type; 4010var baseClass = model.GetTypeInfo(instance).Type;
Symbols\FunctionPointerTypeSymbolTests.cs (5)
1267Assert.Equal("delegate*<C.D>", typeInfo.Type.ToTestDisplayString()); 1268Assert.True(((IFunctionPointerTypeSymbol)typeInfo.Type!).Signature.ReturnType.IsErrorType()); 1271Assert.Equal("C.D", nestedTypeInfo.Type!.ToTestDisplayString()); 1272Assert.False(nestedTypeInfo.Type!.IsErrorType()); 1743Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString());
Symbols\GenericConstraintTests.cs (2)
7395Assert.Equal("Base.Nest", model.GetTypeInfo(nest).Type.ToDisplayString()); 7420Assert.Equal("Base.Nest", model.GetTypeInfo(nest).Type.ToDisplayString());
Symbols\IndexerTests.cs (1)
2640var type = model.GetTypeInfo(syntax).Type.GetSymbol();
Symbols\RequiredMembersTests.cs (1)
6953var tupleType = model.GetTypeInfo(tuple).Type.GetSymbol<NamedTypeSymbol>()!;
Symbols\Source\BaseClassTests.cs (1)
2033Assert.Equal(SpecialType.System_Int32, typeInfo.Type.SpecialType);
Symbols\Source\FileModifierTests.cs (10)
1235Assert.Equal(expectedSymbol.GetPublicSymbol(), info.Type); 1369Assert.Equal(c1.GetPublicSymbol(), info.Type); 1435Assert.Equal(c1.GetPublicSymbol(), info.Type); 1493Assert.Equal(c1.GetPublicSymbol(), info.Type); 1807Assert.Equal(expectedSymbol.GetPublicSymbol(), info.Type); 1882Assert.Equal(expectedSymbol.GetPublicSymbol(), info.Type); 4126Assert.Equal("System.Void@<tree 0>", typeInfo.Type!.ToDisplayString(SymbolDisplayFormat.TestFormat.WithCompilerInternalOptions(SymbolDisplayCompilerInternalOptions.IncludeContainingFileForFileTypes))); 4411var type = (INamedTypeSymbol)model.GetTypeInfo(node.Type!).Type!; 4455var type = (INamedTypeSymbol)model.GetTypeInfo(node.Type!).Type!; 4478var type = (INamedTypeSymbol)model.GetTypeInfo(node.Type!).Type!;
Symbols\Source\NullablePublicAPITests.cs (21)
2920Assert.Equal(PublicNullableAnnotation.Annotated, typeInfo.Type.NullableAnnotation); 2924Assert.Equal(PublicNullableAnnotation.NotAnnotated, typeInfo.Type.NullableAnnotation); 2929Assert.Equal(PublicNullableAnnotation.None, typeInfo.Type.NullableAnnotation); 4248Assert.Equal(SpecialType.System_String, symbolInfo.Type.SpecialType); 4821Assert.Equal(PublicNullableAnnotation.NotAnnotated, info.Type.NullableAnnotation); 4826Assert.Equal(PublicNullableAnnotation.NotAnnotated, info.Type.NullableAnnotation); 4916Assert.Equal(PublicNullableAnnotation.NotAnnotated, typeInfo.Type.NullableAnnotation); 5011AssertEx.Equal("(System.String a, System.String b)", model.GetTypeInfo(tupleLiteral).Type.ToTestDisplayString(includeNonNullable: false)); 5055AssertEx.Equal("System.String?", model.GetTypeInfo(assignmentsInLambda[0].Right).Type.ToTestDisplayString(includeNonNullable: true)); 5056AssertEx.Equal("System.String!", model.GetTypeInfo(assignmentsInLambda[2].Right).Type.ToTestDisplayString(includeNonNullable: true)); 5068AssertEx.Equal("System.String!", model.GetTypeInfo(switchExpressionInput).Type.ToTestDisplayString(includeNonNullable: true)); 5072AssertEx.Equal("System.String!", model.GetTypeInfo(switchExpressionInput).Type.ToTestDisplayString(includeNonNullable: true)); 5103Assert.Equal("System.Object?", model.GetTypeInfo(binaryRight).Type.ToTestDisplayString(includeNonNullable: true)); 5135Assert.Equal("System.Object?", model.GetTypeInfo(binaryRight).Type.ToTestDisplayString(includeNonNullable: true)); 5163Assert.Equal("System.Object?", model.GetTypeInfo(binaryRightArgument).Type.ToTestDisplayString(includeNonNullable: true)); 5199Assert.NotNull(typeInfo.Type); 5200Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 5201Assert.Equal(expectedAnnotation, typeInfo.Type.NullableAnnotation); 5234Assert.NotNull(typeInfo.Type); 5235Assert.Equal(SpecialType.System_String, typeInfo.Type.SpecialType); 5236Assert.Equal(PublicNullableAnnotation.None, typeInfo.Type.NullableAnnotation);
Symbols\Source\UsingAliasTests.cs (3)
105var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 220var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 275var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type;
Symbols\TypeTests.cs (5)
1775Assert.NotNull(tinfo.Type); 1776Assert.Equal(TypeKind.Interface, ((ITypeSymbol)tinfo.Type).TypeKind); 1777Assert.Equal("NS.IGoo<float, System.PlatformID>", tinfo.Type.ToDisplayString()); 1780Assert.True(((ITypeSymbol)tinfo.Type).IsNullableType()); 1781Assert.Equal("float?", tinfo.Type.ToDisplayString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CompilationTestUtils.cs (8)
238summary.Type = typeInfo.Type; 249summary.Type = typeInfo.Type; 266summary.Type = typeInfo.Type; 275summary.Type = typeInfo.Type; 312summary.Type = typeInfo.Type; 357if (typeInfo.Type is null) 363Assert.Equal(typeInfo.Type.NullableAnnotation, iop.Type.NullableAnnotation); 477(annotation.IsConverted ? typeInfo.ConvertedType : typeInfo.Type).GetSymbol(),
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
CodeGen\WinMdEventTests.cs (1)
673Assert.Equal(SpecialType.System_Void, type.Type.SpecialType);
CodeGen\WinRTCollectionTests.cs (1)
7430var jsonObjType = model.GetTypeInfo(jsonObj).Type;
Microsoft.CodeAnalysis.CSharp.Workspaces (81)
Recommendations\CSharpRecommendationServiceRunner.cs (6)
67explicitLambdaParameterType = _context.SemanticModel.GetTypeInfo(parameter.Type, _cancellationToken).Type; 543var container = _context.SemanticModel.GetTypeInfo(identifier, _cancellationToken).Type; 593var container = _context.SemanticModel.GetTypeInfo(expression, _cancellationToken).Type; 603var container = _context.SemanticModel.GetTypeInfo(expression, _cancellationToken).Type; 618var container = _context.SemanticModel.GetTypeInfo(expression, _cancellationToken).Type; 867: semanticModel.GetTypeInfo(originalExpression, _cancellationToken).Type;
Simplification\CSharpSimplificationService.Expander.cs (4)
82var objectCreationType = _semanticModel.GetTypeInfo(objectCreationExpression).Type; 801if (typeinfo.Type != null && typeinfo.Type.TypeKind == TypeKind.Dynamic) 1025var type = semanticModel.GetTypeInfo(typeOfExpression.Type, _cancellationToken).Type as INamedTypeSymbol;
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (1)
52var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (4)
155var type = semanticModel.GetTypeInfo(node, cancellationToken).Type; 169var type = semanticModel.GetTypeInfo(node, cancellationToken).Type; 294if (!symbol.Equals(typeInfo.Type)) 391semanticModel.GetTypeInfo(invocationExpr).Type.SpecialType == SpecialType.System_String;
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
375var type = semanticModel.GetTypeInfo(memberAccess.GetRequiredParent(), cancellationToken).Type;
Simplification\Simplifiers\NameSimplifier.cs (1)
250var type = semanticModel.GetTypeInfo(name, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
127var containingType = semanticModel.GetTypeInfo(containingTypeName, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
52var entityType = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type; 53var defaultType = semanticModel.GetTypeInfo(defaultExpression.Type, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
388expressionTypes.Type.IsInlineArray())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
76if (semanticModel.GetTypeInfo(varDecl.Type, cancellationToken).Type.IsSpanOrReadOnlySpan()) 313var potentialType = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (4)
115if (typeInfo.Type != null) 117symbol = typeInfo.Type; 417if (info.Type == null) 422return semanticModel.GenerateNameFromType(info.Type, CSharpSyntaxFacts.Instance, capitalize);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
38var type = semanticModel.GetTypeInfo(typeSyntax).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
366var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (18)
120var enumType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol; 121var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 155var enumType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol; 156var castedType = semanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type; 160var parentCastType = semanticModel.GetTypeInfo(parentCast.Type, cancellationToken).Type; 486var castedExpressionType = originalSemanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 487var isType = originalSemanticModel.GetTypeInfo(isExpression.Right, cancellationToken).Type; 574var castedType = originalSemanticModel.GetTypeInfo(castNode, cancellationToken).Type; 649var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 840var castType = originalSemanticModel.GetTypeInfo(castExpression, cancellationToken).Type; 861=> IsNullOrErrorType(info.Type) || IsNullOrErrorType(info.ConvertedType); 986var castSideType = semanticModel.GetTypeInfo(castSide, cancellationToken).Type; 987var castedExpressionType = semanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type; 991var otherSideType = semanticModel.GetTypeInfo(otherSide, cancellationToken).Type; 1009var castType = semanticModel.GetTypeInfo(castNode, cancellationToken).Type; 1010var castedExpressionType = semanticModel.GetTypeInfo(castedExpressionNode, cancellationToken).Type; 1051return typeInfo.Type?.Kind == SymbolKind.ArrayType; 1237var rewrittenType = rewrittenSemanticModel.GetTypeInfo(rewrittenExpression, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (15)
386var originalExpressionType = originalExpressionTypeInfo.Type; 387var newExpressionType = newExpressionTypeInfo.Type; 435var originalCaseType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode, this.CancellationToken).Type; 436var newCaseType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode, this.CancellationToken).Type; 494if (!Equals(originalExprType.Type, replacedExprType.Type)) 545if (!Equals(originalExpressionTypeInfo.Type, newExpressionTypeInfo.Type)) 561var originalExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 562var newExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(replacedAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type; 702var originalConvertedType = this.OriginalSemanticModel.GetTypeInfo(originalIsOrAsExpression.Right).Type; 703var newConvertedType = this.SpeculativeSemanticModel.GetTypeInfo(newIsOrAsExpression.Right).Type; 758SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType)) 785SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType)) 804SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
79var declaredTypeSymbol = semanticModel.GetTypeInfo(variableDeclaration.Type.StripRefIfNeeded(), cancellationToken).Type; 97? IsMadeOfSpecialTypes(semanticModel.GetTypeInfo(typeSyntax.StripRefIfNeeded()).Type) 137semanticModel.GetTypeInfo(typeSyntax).Type?.IsSpecialType() == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (2)
149var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type; 157return !initializerTypeInfo.Type.IsErrorType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (4)
195var declarationType = semanticModel.GetTypeInfo(declarationTypeNode, cancellationToken).Type; 205var newDeclarationType = newSemanticModel.GetTypeInfo(newDeclarationTypeNode, cancellationToken).Type; 293var declaredType = semanticModel.GetTypeInfo(typeName.StripRefIfNeeded(), cancellationToken).Type; 332var initializerType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
694return typeInfo.Type.IsNumericType();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
123SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 180name.SpanStart, name, SpeculativeBindingOption.BindAsExpression).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (4)
29return typeInfo.Type?.IsErrorType() == false ? typeInfo.Type : semanticModel.Compilation.ObjectType; 36if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
63return Equals(localSymbol.Type, rightType.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
141var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (1)
13=> typeInfo.Type?.WithNullableAnnotation(typeInfo.Nullability.Annotation);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
ChangeSignature\AddedParameterOrExistingIndex.cs (2)
68LanguageNames.CSharp => semanticModel.GetSpeculativeTypeInfo(0, CSharp.SyntaxFactory.ParseTypeName(_addedParameterFullyQualifiedTypeName!), SpeculativeBindingOption.BindAsTypeOrNamespace).Type, 69LanguageNames.VisualBasic => semanticModel.GetSpeculativeTypeInfo(0, VisualBasic.SyntaxFactory.ParseTypeName(_addedParameterFullyQualifiedTypeName!), SpeculativeBindingOption.BindAsTypeOrNamespace).Type,
Microsoft.CodeAnalysis.Features (75)
AddImport\AbstractAddImportFeatureService.cs (2)
632return semanticModel.GetTypeInfo(innerExpression).Type; 644return semanticModel.GetTypeInfo(collectionExpression).Type;
ChangeSignature\AbstractChangeSignatureService.cs (1)
1063return !semanticModel.Compilation.HasImplicitConversion(fromType.Type, toType);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (2)
77if (!model.GetTypeInfo(node.GetRequiredParent().GetRequiredParent(), cancellationToken).Type.IsErrorType()) 104var type = model.GetTypeInfo(node, cancellationToken).Type;
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
123var type = typeInfo.Type;
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
89receiverTypeSymbol = syntaxContext.SemanticModel.GetTypeInfo(expressionNode, cancellationToken).Type;
ConvertAnonymousType\AbstractConvertAnonymousTypeCodeRefactoringProvider.cs (1)
30var anonymousType = semanticModel.GetTypeInfo(anonymousObject, cancellationToken).Type as INamedTypeSymbol;
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
201var childType = semanticModel.GetTypeInfo(childCreation, cancellationToken).Type;
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
92if (semanticModel.GetTypeInfo(childNode, cancellationToken).Type is INamedTypeSymbol childType)
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
49var type = semanticModel.GetTypeInfo(typeNode, cancellationToken).Type;
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (3)
105if (collectionType.Type is null or IErrorTypeSymbol) 117containingType, collectionType.Type, 139containingType, collectionType.Type, iterationType, cancellationToken),
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
47var symbol = semanticModel.GetTypeInfo(numericLiteralNode, cancellationToken).Type;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
83var lastArgumentType = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfArgument(lastArgument), cancellationToken).Type; 92var type = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfArgument(argument)).Type;
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (3)
207var tupleType = semanticModel.GetTypeInfo(expressionOrType, cancellationToken).Type as INamedTypeSymbol; 649if (semanticModel.GetTypeInfo(childCreation, cancellationToken).Type is not INamedTypeSymbol childType) 762if (semanticModel.GetTypeInfo(childTupleType, cancellationToken).Type is not INamedTypeSymbol childType)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
1968var oldType = oldModel.GetTypeInfo(oldTypedNodes[t], cancellationToken).Type; 1969var newType = newModel.GetTypeInfo(newTypedNodes[t], cancellationToken).Type;
EmbeddedLanguages\AbstractLanguageDetector.cs (2)
127if (exprType.Type != null && 128TryGetOptions(semanticModel, exprType.Type, expr, cancellationToken, out var options))
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
67var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
171var type = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
ExtractMethod\MethodExtractor.cs (1)
278var currentType = semanticModel.GetSpeculativeTypeInfo(contextNode.SpanStart, typeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
GenerateType\AbstractGenerateTypeService.cs (1)
202var type = argument == null ? null : semanticModel.GetTypeInfo(argument, cancellationToken).Type;
GenerateType\AbstractGenerateTypeService.State.cs (1)
163if (typeInfo.Type.IsModuleType())
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
70var expressionType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
44var type = semanticModel.GetTypeInfo(expression).Type;
IntroduceVariable\AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs (1)
114return typeInfo.Type ?? typeInfo.ConvertedType ?? semanticModel.Compilation.GetSpecialType(SpecialType.System_Object);
IntroduceVariable\AbstractIntroduceVariableService.cs (3)
412if (typeInfo.Type?.SpecialType == SpecialType.System_String && 418if (typeInfo.Type != null) 420return typeInfo.Type;
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
79var expressionType = Document.SemanticModel.GetTypeInfo(Expression, cancellationToken).Type;
IntroduceVariable\AbstractIntroduceVariableService.State_ConstructorInitializer.cs (1)
38if (info.Type.ContainsAnonymousType())
IntroduceVariable\AbstractIntroduceVariableService.State_Field.cs (1)
45if (info.Type.ContainsAnonymousType())
IntroduceVariable\AbstractIntroduceVariableService.State_Query.cs (2)
32if (info.Type == null || info.Type.SpecialType == SpecialType.System_Void)
QuickInfo\CommonSemanticQuickInfoProvider.cs (2)
228if (IsOk(typeInfo.Type)) 230return new TokenInformation([typeInfo.Type]);
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
285var conditionalType = semanticModel.GetTypeInfo(conditionalExpression, cancellationToken).Type;
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
74var collectionType = semanticModel.GetTypeInfo(syntaxFacts.GetExpressionOfForeachStatement(node), cancellationToken).Type;
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
155typeInfo.Type?.SpecialType == SpecialType.System_Boolean &&
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
168return invocation.SemanticModel?.GetTypeInfo(expression).Type as INamedTypeSymbol;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
166var exprType = semanticModel.GetTypeInfo(initializer, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
115if (!nullableType.Equals(type.Type?.OriginalDefinition))
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
105conditionLeftIsNull ? conditionRightLow : conditionLeftLow, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (1)
169if (typeInfo.Type is IDynamicTypeSymbol || typeInfo.ConvertedType is IDynamicTypeSymbol)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
187var type = this.SemanticModel.GetTypeInfo(_objectCreationExpression, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
144if (objectType.Type == null || !objectType.Type.AllInterfaces.Contains(ienumerableType))
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
154var parameterType = semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (3)
147var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type; 151var type = semanticModel.GetTypeInfo(conditionalExpression, cancellationToken).Type; 359var typeSymbol = semanticModel.GetTypeInfo(type, cancellationToken).Type;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (2)
85var whenPartType = semanticModel.GetTypeInfo(whenPartMatch, cancellationToken).Type; 89var whenPartIsNullable = semanticModel.GetTypeInfo(whenPartMatch).Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
122var type = this.SemanticModel.GetTypeInfo(_objectCreationExpression, cancellationToken).Type;
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
143var castType = semanticModel.GetTypeInfo(castTypeNode, cancellationToken).Type;
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
169&& semanticModel.GetTypeInfo(argumentExpression, cancellationToken).Type is ITypeSymbol argumentType
src\Analyzers\Core\CodeFixes\AddExplicitCast\InheritanceDistanceComparer.cs (1)
49var baseType = _semanticModel.GetTypeInfo(x.syntax).Type;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (4)
482if (argumentTypeInfo.Type == null && argumentTypeInfo.ConvertedType == null) 538if (parameterType.Equals(argumentTypeInfo.Type) || parameterType.Equals(argumentTypeInfo.ConvertedType)) 559if (argumentTypeInfo.Type != null) 561var conversion = compilation.ClassifyCommonConversion(argumentTypeInfo.Type, parameterType);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (7)
128if (typeInfo.Type is IPointerTypeSymbol pointerType) 146typeToGenerateIn = attributeType.Type as INamedTypeSymbol; 154typeToGenerateIn = semanticModel.GetTypeInfo(initializedObject, cancellationToken).Type as INamedTypeSymbol; 189typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter 191: typeInfo.Type as INamedTypeSymbol; 194isColorColorCase = typeInfo.Type != null && semanticInfo.Symbol != null && semanticInfo.Symbol.Name == typeInfo.Type.Name;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
602var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
Microsoft.CodeAnalysis.VisualBasic (2)
Compilation\VisualBasicCompilation.vb (2)
847Return info.Type.SpecialType <> SpecialType.System_Void 852Return info.Type.SpecialType <> SpecialType.System_Void
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (17)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (2)
56If symbolInfo.Type IsNot Nothing AndAlso symbolInfo.Type.Equals(symbolInfo.ConvertedType, SymbolEqualityComparer.Default) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
111If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.SpecialType = SpecialType.System_Void Then 120Dim symbol = If(typeInfo.Type, symbolInfo.GetAnySymbol())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (4)
58If typeInfo.Type IsNot Nothing Then 59symbol = typeInfo.Type 233If info.Type Is Nothing Then 237Return semanticModel.GenerateNameFromType(info.Type, VisualBasicSyntaxFacts.Instance, capitalize)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (8)
65Return semanticModel.GetTypeInfo(parentExpression, cancellationToken).Type 69If Not Object.Equals(expressionTypeInfo.Type, expressionTypeInfo.ConvertedType) Then 93Return semanticModel.GetTypeInfo(parentAssignmentStatement.Left, cancellationToken).Type 110Return semanticModel.GetTypeInfo(otherExpression, cancellationToken).Type 116Return semanticModel.GetTypeInfo(parentSimpleArgument.Expression, cancellationToken).Type 152Return semanticModel.GetTypeInfo(asClause.Type).Type 200Dim castType = castTypeInfo.Type 212castExpressionType = _semanticModel.GetTypeInfo(_castExpressionNode, _cancellationToken).Type
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (9)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
144SpeculativeBindingOption.BindAsTypeOrNamespace).Type
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
156Dim type = semanticModel.GetTypeInfo(expression, cancellationToken).Type
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (7)
30If info.Type IsNot Nothing AndAlso info.Type.TypeKind <> TypeKind.Error Then 31Return CreateResult(info.Type) 262If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.IsEnumType() Then 263Return CreateResult(typeInfo.Type) 281If TypeOf expressionType.Type Is IArrayTypeSymbol Then
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
EndConstructGeneration\EndConstructStatementVisitor_CustomEvents.vb (2)
43Return {aligningWhitespace & SyntaxFacts.GetText(kind) & "(value As " & type.Type.ToMinimalDisplayString(_state.SemanticModel, position, SymbolDisplayFormats.NameFormat) & ")", 49Dim type = TryCast(_state.SemanticModel.GetTypeInfo(DirectCast(eventStatement.AsClause, SimpleAsClauseSyntax).Type, Me._cancellationToken).Type, INamedTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (7)
CodeGen\CodeGenTuples.vb (7)
11778Assert.Equal("(e As System.Int32, f As System.String)", typeInfo.Type.ToTestDisplayString()) 11785Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 11792Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 11897Assert.Equal("(System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()) 11927Assert.Equal("(e As System.Int32, f As System.String)", typeInfo.Type.ToTestDisplayString()) 11934Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 11941Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString())
Microsoft.CodeAnalysis.VisualBasic.Features (24)
AddImport\VisualBasicAddImportFeatureService.vb (3)
262type = semanticModel.GetTypeInfo(fromClause.Variables.First().Expression, cancellationToken).Type 265type = semanticModel.GetTypeInfo(aggregateClause.Variables.First().Expression, cancellationToken).Type 347leftExpressionType = semanticInfo.Type
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (2)
172Dim typeSymbol = TryCast(semanticModel.GetTypeInfo(handlerExpression, cancellationToken).Type, INamedTypeSymbol) 213eventType = TryCast(semanticModel.GetTypeInfo(qualifier, cancellationToken).Type, INamedTypeSymbol)
Completion\CompletionProviders\AwaitCompletionProvider.vb (1)
60Return If(TypeOf symbol Is ITypeSymbol, Nothing, semanticModel.GetTypeInfo(memberAccessExpression, cancellationToken).Type)
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
178Dim leftType = semanticModel.GetTypeInfo(qualifiedName.Left, cancellationToken).Type
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
164Dim container As INamespaceOrTypeSymbol = leftHandTypeInfo.Type
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (2)
144Dim type = TryCast(semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type, INamedTypeSymbol) 160Dim attributeType = TryCast(semanticModel.GetTypeInfo(attribute, cancellationToken).Type, INamedTypeSymbol)
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (2)
42If info.Type.IsErrorType() Then 46Return If(info.ConvertedType.IsObjectType(), info.ConvertedType, info.Type)
ExtractMethod\VisualBasicSelectionResult.vb (5)
192Return If(info.Type.IsObjectType(), info.ConvertedType, info.Type) 221If If(info.Type?.SpecialType = SpecialType.System_String, False) AndAlso 228Return If(info.Type.IsObjectType(), info.ConvertedType, info.Type)
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (2)
228If typeInfo.Type IsNot Nothing Then 229builder.AddRange(typeInfo.Type.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\AttributeSignatureHelpProvider.vb (1)
63Dim attributeType = TryCast(semanticModel.GetTypeInfo(attribute, cancellationToken).Type, INamedTypeSymbol)
SignatureHelp\InvocationExpressionSignatureHelpProvider.ElementAccess.vb (1)
24throughType = semanticModel.GetTypeInfo(leftExpression, cancellationToken).Type
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.vb (1)
73Dim type = TryCast(semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type, INamedTypeSymbol)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (2)
56If symbolInfo.Type IsNot Nothing AndAlso symbolInfo.Type.Equals(symbolInfo.ConvertedType, SymbolEqualityComparer.Default) Then
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (224)
Binding\MethodBodyBindingTests.vb (2)
524Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 718Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString())
Compilation\SemanticModelAPITests.vb (10)
620Assert.NotNull(initializerTypeInfo.Type) 621Assert.Equal("System.Int32", initializerTypeInfo.Type.ToTestDisplayString()) 673Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 726Assert.Equal("System.Int16", typeInfo.Type.ToTestDisplayString()) 781Assert.NotNull(typeInfo.Type) 782Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1453Assert.NotNull(typeInfo.Type) 1454Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1734Dim typeSymbol = speculativeModel.GetTypeInfo(speculatedTypeSyntax).Type 1749typeSymbol = speculativeModel.GetTypeInfo(right).Type
Compilation\SuppressAccessibilityChecksTests.vb (2)
90Assert.Equal("A", creationExpression.Type.Name) 270Assert.Equal("Int32", typeSpeculation.Type.Name)
Semantics\CompoundAssignment.vb (5)
300Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 313Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1027Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1041Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1055Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString())
Semantics\ConditionalAccessTests.vb (25)
647Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 659Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 669Assert.Equal("System.Nullable(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 680Assert.Equal("System.Nullable(Of S1)", typeInfo.Type.ToTestDisplayString()) 1327Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1337Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1348Assert.Equal("System.Func(Of System.Int32, System.String)", typeInfo.Type.ToTestDisplayString()) 1361Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1372Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1383Assert.Equal("System.String()", typeInfo.Type.ToTestDisplayString()) 1396Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1406Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1417Assert.Equal("C1", typeInfo.Type.ToTestDisplayString()) 1494Assert.Null(typeInfo.Type) 1506Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1515Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1526Assert.Equal("System.Xml.Linq.XElement", typeInfo.Type.ToTestDisplayString()) 1537Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.Type.ToTestDisplayString()) 1549Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.Type.ToTestDisplayString()) 1558Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.Type.ToTestDisplayString()) 1569Assert.Equal("System.Xml.Linq.XElement", typeInfo.Type.ToTestDisplayString()) 1580Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.Type.ToTestDisplayString()) 1592Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.Type.ToTestDisplayString()) 1601Assert.Equal("System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", typeInfo.Type.ToTestDisplayString()) 1612Assert.Equal("System.Xml.Linq.XElement", typeInfo.Type.ToTestDisplayString())
Semantics\Conversions_AnonymousDelegates.vb (27)
51Assert.Equal("Sub <generated method>(x As System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.Type.ToTestDisplayString()) 142Assert.Equal("Sub <generated method>(x As System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.Type.ToTestDisplayString()) 199Assert.Equal("Sub <generated method>(x As System.Collections.Generic.IEnumerable(Of System.Int32))", typeInfo.Type.ToTestDisplayString()) 284Assert.Equal("Sub <generated method>(x As System.Object)", typeInfo.Type.ToTestDisplayString()) 365Assert.Equal("Sub <generated method>(x As System.Object)", typeInfo.Type.ToTestDisplayString()) 389Assert.Equal("Sub <generated method>(x As System.Object)", typeInfo.Type.ToTestDisplayString()) 433Assert.Equal("Sub <generated method>(x As System.Int32)", typeInfo.Type.ToTestDisplayString()) 514Assert.Equal("Sub <generated method>(x As System.Int32)", typeInfo.Type.ToTestDisplayString()) 544Assert.Equal("Sub <generated method>(x As System.Int32)", typeInfo.Type.ToTestDisplayString()) 951Assert.Equal("Sub <generated method>(x As System.Collections.IEnumerable)", typeInfo.Type.ToTestDisplayString()) 1037Assert.Equal("Sub <generated method>(x As System.Guid)", typeInfo.Type.ToTestDisplayString()) 1090Assert.Equal("Function <generated method>() As System.Int32", typeInfo.Type.ToTestDisplayString()) 1192Assert.Equal("Sub <generated method>()", typeInfo.Type.ToTestDisplayString()) 1240Assert.Equal("Function <generated method>() As System.Object", typeInfo.Type.ToTestDisplayString()) 1319Assert.Equal("Function <generated method>() As System.Object", typeInfo.Type.ToTestDisplayString()) 1350Assert.Equal("Function <generated method>() As System.Object", typeInfo.Type.ToTestDisplayString()) 1402Assert.Equal("Function <generated method>() As System.Int32", typeInfo.Type.ToTestDisplayString()) 1507Assert.Equal("Function <generated method>() As System.Collections.Generic.IEnumerable(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1593Assert.Equal("Function <generated method>() As System.Int32", typeInfo.Type.ToTestDisplayString()) 1640Assert.Equal("Function <generated method>() As System.Int32", typeInfo.Type.ToTestDisplayString()) 1718Assert.Equal("Function <generated method>() As System.Int32", typeInfo.Type.ToTestDisplayString()) 1741Assert.Equal("Function <generated method>() As System.Int32", typeInfo.Type.ToTestDisplayString()) 1789Assert.Equal("Function <generated method>(y As System.Int32) As System.Int32", typeInfo.Type.ToTestDisplayString()) 1837Assert.Equal("Function <generated method>(ByRef y As System.Int32) As System.Int32", typeInfo.Type.ToTestDisplayString()) 1892Assert.Equal("Sub <generated method>(ByRef y As System.Object)", typeInfo.Type.ToTestDisplayString()) 1989Assert.Equal("Sub <generated method>(ByRef y As System.Object)", typeInfo.Type.ToTestDisplayString()) 2020Assert.Equal("Sub <generated method>(ByRef y As System.Object)", typeInfo.Type.ToTestDisplayString())
Semantics\GetExtendedSemanticInfoTests.vb (10)
9056Assert.Null(typeInfo.Type) 9076Assert.Equal("X", typeInfo.Type.ToTestDisplayString()) 9120Assert.Null(typeInfo.Type) 9137Assert.Equal("X", typeInfo.Type.ToTestDisplayString()) 9184Assert.Null(typeInfo.Type) 9202Assert.Equal("X", typeInfo.Type.ToTestDisplayString()) 9249Assert.Null(typeInfo.Type) 9269Assert.Equal("X", typeInfo.Type.ToTestDisplayString()) 9310Assert.Null(typeInfo.Type) 9327Assert.Equal("X", typeInfo.Type.ToTestDisplayString())
Semantics\GetSemanticInfoTests.vb (6)
5357Assert.Null(typeInfo.Type) 5373Assert.Equal("Test.C", typeInfo.Type.ToTestDisplayString()) 5446Assert.Null(typeInfo.Type) 5462Assert.Equal("Test.I", typeInfo.Type.ToTestDisplayString()) 5551Assert.Null(typeInfo.Type) 5566Assert.Equal("Test.I", typeInfo.Type.ToTestDisplayString())
Semantics\Lambda_AnonymousDelegateInference.vb (3)
443Assert.Null(typeInfo.Type) 455Assert.Null(typeInfo.Type) 467Assert.Null(typeInfo.Type)
Semantics\Lambda_Relaxation.vb (31)
44Assert.Null(typeInfo.Type) 160Assert.Null(typeInfo.Type) 258Assert.Null(typeInfo.Type) 356Assert.Null(typeInfo.Type) 451Assert.Null(typeInfo.Type) 857Assert.Null(typeInfo.Type) 932Assert.Null(typeInfo.Type) 977Assert.Null(typeInfo.Type) 1032Assert.Null(typeInfo.Type) 1187Assert.Null(typeInfo.Type) 1249Assert.Null(typeInfo.Type) 1300Assert.Null(typeInfo.Type) 1312Assert.Null(typeInfo.Type) 1413Assert.Null(typeInfo.Type) 1425Assert.Null(typeInfo.Type) 1458Assert.Null(typeInfo.Type) 1470Assert.Null(typeInfo.Type) 1524Assert.Null(typeInfo.Type) 1623Assert.Null(typeInfo.Type) 1700Assert.Null(typeInfo.Type) 1754Assert.Null(typeInfo.Type) 1766Assert.Null(typeInfo.Type) 1914Assert.Null(typeInfo.Type) 1926Assert.Null(typeInfo.Type) 1938Assert.Null(typeInfo.Type) 1950Assert.Null(typeInfo.Type) 2006Assert.Null(typeInfo.Type) 2059Assert.Null(typeInfo.Type) 2151Assert.Null(typeInfo.Type) 2179Assert.Null(typeInfo.Type) 2234Assert.Null(typeInfo.Type)
Semantics\MeMyBaseMyClassTests.vb (2)
586Assert.NotNull(typeInfo.Type) 587Assert.Equal(expectedTypeInfo, typeInfo.Type.ToDisplayString())
Semantics\NameOfTests.vb (100)
63Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 75Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 87Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 100Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 112Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 128Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 140Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 460Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 472Assert.Null(typeInfo.Type) 484Assert.Null(typeInfo.Type) 532Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 544Assert.Null(typeInfo.Type) 558Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 567Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 616Assert.Null(typeInfo.Type) 668Assert.Null(typeInfo.Type) 718Assert.Null(typeInfo.Type) 771Assert.Null(typeInfo.Type) 821Assert.Null(typeInfo.Type) 871Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 883Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 895Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 948Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 960Assert.Equal("C2(Of System.Int32).Cc3(Of S)", typeInfo.Type.ToTestDisplayString()) 973Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1061Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1073Assert.Equal("C2.Cc3", typeInfo.Type.ToTestDisplayString()) 1086Assert.Equal("C2", typeInfo.Type.ToTestDisplayString()) 1129Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1141Assert.Null(typeInfo.Type) 1194Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1206Assert.Null(typeInfo.Type) 1220Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 1229Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1276Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1288Assert.Null(typeInfo.Type) 1302Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 1311Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1358Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1370Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1383Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 1392Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1439Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1451Assert.Null(typeInfo.Type) 1464Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 1473Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1519Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1531Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 1544Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", typeInfo.Type.ToTestDisplayString()) 1553Assert.Equal("C2(Of System.Int32)", typeInfo.Type.ToTestDisplayString()) 1650Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1662Assert.Equal("System.Void", typeInfo.Type.ToTestDisplayString()) 1743Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1755Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1800Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1812Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 1857Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1869Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 1914Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 1926Assert.Equal("System.Object", typeInfo.Type.ToTestDisplayString()) 2056Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2068Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 2081Assert.Equal("C2", typeInfo.Type.ToTestDisplayString()) 2155Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2167Assert.Null(typeInfo.Type) 2180Assert.Equal("C2", typeInfo.Type.ToTestDisplayString()) 2256Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2268Assert.Null(typeInfo.Type) 2281Assert.Equal("C2", typeInfo.Type.ToTestDisplayString()) 2362Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2374Assert.Null(typeInfo.Type) 2387Assert.Equal("C2", typeInfo.Type.ToTestDisplayString()) 2466Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2478Assert.Equal("System.Action", typeInfo.Type.ToTestDisplayString()) 2491Assert.Equal("C2", typeInfo.Type.ToTestDisplayString()) 2799Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2811Assert.Null(typeInfo.Type) 2824Assert.Equal("Test", typeInfo.Type.ToTestDisplayString()) 2874Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2886Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 2939Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 2951Assert.Equal(SymbolKind.ErrorType, typeInfo.Type.Kind) 3001Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3013Assert.Null(typeInfo.Type) 3062Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3074Assert.Null(typeInfo.Type) 3123Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3135Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3183Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3195Assert.Equal("System.Action", typeInfo.Type.ToTestDisplayString()) 3247Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3259Assert.Null(typeInfo.Type) 3308Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3320Assert.Equal("System.Int32", typeInfo.Type.ToTestDisplayString()) 3365Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3377Assert.Equal("System.Action", typeInfo.Type.ToTestDisplayString()) 3423Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3435Assert.Null(typeInfo.Type) 3479Assert.Equal("System.String", typeInfo.Type.ToTestDisplayString()) 3491Assert.Null(typeInfo.Type)
Semantics\Parenthesized.vb (1)
247Assert.Null(typeInfo.Type)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (44)
DocumentationComments\DocCommentTests.vb (14)
10099Assert.Null(typeInfo.Type) 10102Assert.NotNull(typeInfo.Type) 10103Assert.Equal(e.Types(0), typeInfo.Type.ToTestDisplayString()) 10106Assert.Null(typeInfo.Type) 11969Assert.Equal(actual.Symbol, typeInfo.Type) 11971Assert.Null(typeInfo.Type) 12015Assert.Null(typeInfo.Type) 12023Assert.NotNull(typeInfo.Type) 12024Assert.Equal(typeInfo.Type, symbol) 12038Assert.Null(typeInfo.Type) 12044Assert.NotNull(typeInfo.Type) 12045Assert.Equal(typeInfo.Type, actual.Symbol) 12051Assert.Null(typeInfo.Type) 12078Assert.Equal(expected, expTypeInfo.Type.OriginalDefinition)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (23)
632typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 633Assert.Equal(0, typeInfo.Type.Interfaces.Length) 637typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 638Assert.Equal(1, typeInfo.Type.Interfaces.Length) 673Assert.Equal("Public Sub New(f1 As Object, f2 As Object, f3 As Integer)", typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 674Assert.Equal(1, typeInfo.Type.Interfaces.Length) 711Assert.Equal("Public Sub New([module] As D1, Main As Boolean)", typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 712Assert.Equal(1, typeInfo.Type.Interfaces.Length) 713Dim mems = typeInfo.Type.GetMembers() 716Assert.Equal("Public Sub New(mid As <anonymous type: module As D1, Key Main As Boolean>, [mod] As <anonymous type: Key mod As D2>)", typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 717Assert.Equal(0, typeInfo.Type.Interfaces.Length) 754typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 755Assert.Equal(0, typeInfo.Type.Interfaces.Length) 795typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 796Assert.Equal(0, typeInfo.Type.Interfaces.Length) 831typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 832Assert.Equal(1, typeInfo.Type.Interfaces.Length) 873typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 874Assert.Equal(0, typeInfo.Type.Interfaces.Length) 878typeInfo.Type.TheOnlyConstructor.ToDisplayString()) 879Assert.Equal(1, typeInfo.Type.Interfaces.Length) 1619Dim syms1 = model.LookupSymbols(pos, container:=DirectCast(anonymousType.Type, TypeSymbol)) 1662Dim syms1 = model.LookupSymbols(pos, container:=DirectCast(anonymousType.Type, TypeSymbol))
SymbolsTests\Source\GroupClassTests.vb (7)
3281Assert.Equal("DefaultInstanceTest1", typeInfo.Type.ToTestDisplayString()) 3289Assert.Equal("DefaultInstanceTest2", typeInfo.Type.ToTestDisplayString()) 3361Assert.Equal("DefaultInstanceTest2", typeInfo.Type.ToTestDisplayString()) 3767Assert.Equal("Form1", typeInfo.Type.ToTestDisplayString()) 3775Assert.Equal("Form1", typeInfo.Type.ToTestDisplayString()) 3783Assert.Equal("Form1", typeInfo.Type.ToTestDisplayString()) 3791Assert.Equal("Form1", typeInfo.Type.ToTestDisplayString())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (38)
Classification\SyntaxClassification\ImportAliasClauseSyntaxClassifier.vb (2)
31If symbolInfo.Type IsNot Nothing Then 32Dim classification = GetClassificationForType(symbolInfo.Type)
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (2)
97Dim returnType = semanticModel.GetTypeInfo(oldAsClauseOpt.Type, cancellationToken).Type 130Dim returnType = semanticModel.GetTypeInfo(oldAsClauseOpt.Type, cancellationToken).Type
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (1)
132Dim type = Me._model.GetTypeInfo(expression, _cancellationToken).Type
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (2)
96initializerType = semanticModel.GetTypeInfo(variableDeclarator.Initializer.Value).Type 119Dim valueType = semanticModel.GetTypeInfo(DirectCast(parent, ForStatementSyntax).ToValue).Type
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
115Dim type = semanticModel.GetTypeInfo(node).Type
Simplification\Simplifiers\NameSimplifier.vb (1)
159Dim type = semanticModel.GetTypeInfo(name, cancellationToken).Type
Simplification\VisualBasicSimplificationService.Expander.vb (3)
77If typeInfo.Type IsNot Nothing AndAlso 78typeInfo.Type.IsAnonymousDelegateType() AndAlso 795Dim type = TryCast(semanticModel.GetTypeInfo(typeOfExpression.Type, _cancellationToken).Type, INamedTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
111If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.SpecialType = SpecialType.System_Void Then 120Dim symbol = If(typeInfo.Type, symbolInfo.GetAnySymbol())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (4)
58If typeInfo.Type IsNot Nothing Then 59symbol = typeInfo.Type 233If info.Type Is Nothing Then 237Return semanticModel.GenerateNameFromType(info.Type, VisualBasicSyntaxFacts.Instance, capitalize)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (8)
65Return semanticModel.GetTypeInfo(parentExpression, cancellationToken).Type 69If Not Object.Equals(expressionTypeInfo.Type, expressionTypeInfo.ConvertedType) Then 93Return semanticModel.GetTypeInfo(parentAssignmentStatement.Left, cancellationToken).Type 110Return semanticModel.GetTypeInfo(otherExpression, cancellationToken).Type 116Return semanticModel.GetTypeInfo(parentSimpleArgument.Expression, cancellationToken).Type 152Return semanticModel.GetTypeInfo(asClause.Type).Type 200Dim castType = castTypeInfo.Type 212castExpressionType = _semanticModel.GetTypeInfo(_castExpressionNode, _cancellationToken).Type
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
144SpeculativeBindingOption.BindAsTypeOrNamespace).Type
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
156Dim type = semanticModel.GetTypeInfo(expression, cancellationToken).Type
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (7)
30If info.Type IsNot Nothing AndAlso info.Type.TypeKind <> TypeKind.Error Then 31Return CreateResult(info.Type) 262If typeInfo.Type IsNot Nothing AndAlso typeInfo.Type.IsEnumType() Then 263Return CreateResult(typeInfo.Type) 281If TypeOf expressionType.Type Is IArrayTypeSymbol Then
Utilities\IntrinsicOperators\AbstractIntrinsicOperatorDocumentation.vb (2)
45If typeInfo.Type IsNot Nothing Then 46suffixParts.AddRange(typeInfo.Type.ToMinimalDisplayParts(semanticModel, position))
Microsoft.CodeAnalysis.Workspaces (28)
Editing\SymbolEditorExtensions.cs (1)
44var typeRef = gen.GetBaseAndInterfaceTypes(decl).FirstOrDefault(r => model.GetTypeInfo(r, cancellationToken).Type.Equals(baseOrInterfaceType));
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (1)
63if (symbol.Equals(typeInfo.Type, SymbolEqualityComparer.Default))
Shared\Extensions\SemanticModelExtensions.cs (1)
110type = typeInfo.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
238if (typeInfo.Type != null) 240return typeInfo.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (6)
36if (innerTypeInfo.Type != null && innerTypeInfo.ConvertedType != null) 38if (!innerTypeInfo.Type.Equals(innerTypeInfo.ConvertedType)) 43if (innerTypeInfo.Type is IDynamicTypeSymbol) 51if (!Equals(semanticModel.GetTypeInfo(parentBinaryLeft).Type, 52semanticModel.GetTypeInfo(parentBinaryRight).Type)) 116=> IsFloatingPoint(typeInfo.Type) || IsFloatingPoint(typeInfo.ConvertedType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (17)
245if (originalTypeInfo.Type == null) 251if (newTypeInfo.Type == null) 267if (SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.Type)) 273if (originalTypeInfo.Type != null && newTypeInfo.Type == null && 636if (newTypeInfo.Type.IsErrorType() && !originalTypeInfo.Type.IsErrorType()) 740var previousOriginalType = this.OriginalSemanticModel.GetTypeInfo(previousOriginalNode).Type; 741var previousReplacedType = this.SpeculativeSemanticModel.GetTypeInfo(previousReplacedNode).Type; 849var originalThrowExpressionType = this.OriginalSemanticModel.GetTypeInfo(originalThrowExpression).Type; 851var newThrowExpressionType = this.SpeculativeSemanticModel.GetTypeInfo(newThrowExpression).Type; 964var originalTargetType = this.OriginalSemanticModel.GetTypeInfo(originalLeft).Type; 967var newTargetType = this.SpeculativeSemanticModel.GetTypeInfo(newLeft).Type; 1039var receiverType = semanticModel.GetTypeInfo(receiver).Type; 1208if (this.OriginalSemanticModel.GetTypeInfo(originalExpression).Type != null && 1209this.SpeculativeSemanticModel.GetTypeInfo(newExpression).Type != null)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SymbolKeyTests.cs (1)
1278var symbol = semanticModel.GetTypeInfo(node).Type;
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckNameofFixProvider.cs (1)
134var type = semanticModel.GetTypeInfo(argParam.Type, context.CancellationToken).Type;
Microsoft.VisualStudio.LanguageServices (1)
ChangeSignature\AddParameterDialogViewModel.cs (1)
203TypeSymbol = _semanticModel.GetSpeculativeTypeInfo(PositionForTypeBinding, languageService.GetTypeNode(typeName), SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
Microsoft.VisualStudio.LanguageServices.CSharp (9)
CodeModel\CSharpCodeModelService.cs (7)
962? semanticModel.GetTypeInfo(node).Type 3017return semanticModel.GetSpeculativeTypeInfo(position, parsedTypeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 3051typeSymbol = semanticModel.GetSpeculativeTypeInfo(0, parsedTypeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type; 3779if (typeInfo.Type != null && 3780typeInfo.Type.Equals(typeSymbol)) 3867if (typeInfo.Type != null && 3868typeInfo.Type.Equals(typeSymbol))
LanguageService\CSharpHelpContextService.cs (2)
165symbol = semanticModel.GetSymbolInfo(genericName, cancellationToken).Symbol ?? semanticModel.GetTypeInfo(genericName, cancellationToken).Type; 195symbol = info.Type;
Microsoft.VisualStudio.LanguageServices.VisualBasic (11)
CodeModel\VisualBasicCodeModelService.vb (7)
1068semanticModel.GetTypeInfo(node).Type, 3660typeSymbol = semanticModel.GetSpeculativeTypeInfo(0, parsedTypeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type 3674Return semanticModel.GetSpeculativeTypeInfo(position, parsedTypeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type 4296If typeInfo.Type IsNot Nothing AndAlso 4297typeInfo.Type.Equals(typeSymbol) Then 4368If typeInfo.Type IsNot Nothing AndAlso 4369typeInfo.Type.Equals(typeSymbol) Then
Help\VisualBasicHelpContextService.Visitor.vb (4)
448symbol = _semanticModel.GetTypeInfo(node, _cancellationToken).Type 687Dim typeInfo = _semanticModel.GetTypeInfo(node, _cancellationToken).Type 839symbol = _semanticModel.GetTypeInfo(node, _cancellationToken).Type 852symbol = _semanticModel.GetTypeInfo(node.Right, _cancellationToken).Type
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (1)
58if (objectTypeInfo.Type is not INamedTypeSymbol objectType
System.Windows.Forms.Analyzers.VisualBasic (2)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (2)
66If Not (TypeOf objectTypeInfo.Type Is INamedTypeSymbol) Then 70Dim objectType = DirectCast(objectTypeInfo.Type, INamedTypeSymbol)
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
218ITypeSymbol? enumType = semanticModel.GetTypeInfo(argument, cancellationToken).Type;