2 implementations of Type
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\FieldSymbol.cs (1)
38ITypeSymbol IFieldSymbol.Type
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\FieldSymbol.vb (1)
470Private ReadOnly Property IFieldSymbol_Type As ITypeSymbol Implements IFieldSymbol.Type
369 references to Type
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
109IFieldReferenceOperation f => f.Field.Type,
ILLink.RoslynAnalyzer (3)
DynamicallyAccessedMembersAnalyzer.cs (1)
153 if (member is IFieldSymbol field && field.GetDynamicallyAccessedMemberTypes () != DynamicallyAccessedMemberTypes.None && !field.Type.IsTypeInterestingForDataflow (isByRef: field.RefKind is not RefKind.None))
TrimAnalysis\FieldValue.cs (1)
17 StaticType = new (fieldSymbol.Type);
TrimAnalysis\FlowAnnotations.cs (1)
112 if (!field.OriginalDefinition.Type.IsTypeInterestingForDataflow (isByRef: field.RefKind is not RefKind.None))
Microsoft.Analyzers.Extra (1)
ConditionalAccessAnalyzer.cs (1)
60type = fieldRef.Field.Type;
Microsoft.Analyzers.Local (1)
Utilities\SymbolExtensions.cs (1)
168return fieldSymbol.Type;
Microsoft.AspNetCore.Components.Analyzers (1)
InternalUsageAnalyzer.cs (1)
93VisitDeclarationSymbol(context, field.Type, field);
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
InternalUsageAnalyzer.cs (1)
93VisitDeclarationSymbol(context, field.Type, field);
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
156field.Type.SpecialType == SpecialType.System_Int32 &&
Microsoft.CodeAnalysis (2)
Operations\ControlFlowGraphBuilder.cs (1)
7225operation.Syntax, fieldSymbol.Type, constantValue: null, isImplicit: true);
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (1)
108return fieldSymbol.Type;
Microsoft.CodeAnalysis.CodeStyle (10)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
172if (symbol.Type.IsMutableValueType() != false)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
158if (member is not IFieldSymbol fieldSymbol || fieldSymbol.Type.SpecialType != SpecialType.None)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
412if (!getterField.IsReadOnly && getterField.Type.IsMutableValueType() != false) 424if (!property.Type.Equals(getterField.Type))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
328IFieldSymbol fieldSymbol => fieldSymbol.Type, 616IFieldSymbol fieldSymbol => fieldSymbol.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
51return symbol.Type.Accept(this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
44elementTypes.Add(element.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
453if (!AreEquivalent(xElement.Type, yElement.Type, equivalentTypesWithDifferingAssemblies))
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
549_service.IsConversionImplicit(_document.SemanticModel.Compilation, parameterType, field.Type);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
29.Where(f => includeMemberType(f.Type))
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
87generator.TypeExpression(symbol.Type),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
605field.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
90IFieldSymbol field => field.Type,
Microsoft.CodeAnalysis.CSharp (4)
Compilation\CSharpSemanticModel.cs (1)
598return (field.Type, field.NullableAnnotation);
SymbolDisplay\SymbolDisplayVisitor.Members.cs (3)
24symbol.Type.Accept(this.NotFirstVisitor); 87CanAddConstant(symbol.Type, symbol.ConstantValue)) 93AddConstantValue(symbol.Type, symbol.ConstantValue, preferNumericValueOrExpandedFlagsForEnum: IsEnumMember(symbol));
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
94Type.SpecialType: SpecialType.System_Object,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
53var tupleElementType = tupleType.TupleElements[i].Type;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
175var type = elements[i].Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
160var namedType = enumMember.Type as INamedTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (4)
104field.Type.GenerateTypeSyntax(), 115var canUseFieldReference = field.Type != null && !field.Type.Equals(field.ContainingType); 116return EqualsValueClause(ExpressionGenerator.GenerateExpression(generator, field.Type, field.ConstantValue, canUseFieldReference));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
257list = list.Add(TupleElement(element.Type.GenerateTypeSyntax(), name));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1465result.Add(new TypeInferenceInfo(field.Type));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
370ResolveAndVerifyTypeSymbol(list[3], (originalSymbols[3] as IFieldSymbol).Type, model, comp20);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (25)
CodeGen\CodeGenDeconstructTests.cs (11)
3624Assert.Equal(field.Type, model.GetTypeInfo(reference).Type); 5404var xType = ((IFieldSymbol)xSymbol).Type; 5411var yType = ((IFieldSymbol)ySymbol).Type; 5437var xType = ((IFieldSymbol)xSymbol).Type; 5444var yType = ((IFieldSymbol)ySymbol).Type; 5569var xType = ((IFieldSymbol)xSymbol).Type; 5617var yType = ((IFieldSymbol)ySymbol).Type; 5648var x1Type = ((IFieldSymbol)x1Symbol).Type; 5657var x2Type = ((IFieldSymbol)x2Symbol).Type; 5692var x1Type = ((IFieldSymbol)x1Symbol).Type; 5701var x2Type = ((IFieldSymbol)x2Symbol).Type;
CodeGen\CodeGenTupleTest.cs (14)
6405return tuple.TupleElements.Select(t => t.Type.ToTestDisplayString()); 6635var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 6677var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 6716var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 6757var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 6835var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 6865var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 6904var tuple1 = (INamedTypeSymbol)((IFieldSymbol)comp.GetMember("Program.F")).Type; 14277f1Tuple = (INamedTypeSymbol)((IFieldSymbol)symbolInfo.Symbol).Type; 27419VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F0").Single()).Type, TupleUnderlyingTypeValue.Null, "System.ValueTuple", "System.ValueTuple"); 27420VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F1").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Int32, System.Int32)", "(System.Int32, System.Int32)"); 27421VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F2").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Int32 A, System.Int32 B)", "(A As System.Int32, B As System.Int32)"); 27422VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F3").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)", "(System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)"); 27423VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F4").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Object, System.Object B, System.Object, System.Object D, System.Object, System.Object F, System.Object, System.Object H)", "(System.Object, B As System.Object, System.Object, D As System.Object, System.Object, F As System.Object, System.Object, H As System.Object)");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (27)
Semantics\OutVarTests.cs (23)
26431Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl.VariableDesignation())).Type.ToTestDisplayString()); 27028Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl.VariableDesignation())).Type.ToTestDisplayString()); 32203Assert.Equal("var", x1.Type.ToTestDisplayString()); 32204Assert.True(x1.Type.IsErrorType()); 32233Assert.True(b.Type.IsErrorType()); 32244Assert.Equal("System.Int32", x1.Type.ToTestDisplayString()); 32273Assert.True(b.Type.IsErrorType()); 32284Assert.Equal("System.Int32", x1.Type.ToTestDisplayString()); 32313Assert.True(a.Type.IsErrorType()); 32324Assert.Equal("System.Int32", x1.Type.ToTestDisplayString()); 32332Assert.Equal("var", x1.Type.ToTestDisplayString()); 32333Assert.True(x1.Type.IsErrorType()); 32370Assert.Equal("var", x1.Type.ToTestDisplayString()); 32371Assert.True(x1.Type.IsErrorType()); 32387Assert.True(b.Type.IsErrorType()); 32390Assert.Equal("System.Int32", x1.Type.ToTestDisplayString()); 32391Assert.False(x1.Type.IsErrorType()); 32439Assert.Equal("var", x1.Type.ToTestDisplayString()); 32440Assert.True(x1.Type.IsErrorType()); 32489Assert.Equal("var", x1.Type.ToTestDisplayString()); 32490Assert.True(x1.Type.IsErrorType()); 32761AssertInfoForDeclarationExpressionSyntax(model, decl, expectedSymbol: local, expectedType: inFieldDeclaratorArgumentlist ? null : local.Type); 32779Assert.Equal(local.Type, model.GetTypeInfo(reference).Type);
Semantics\PatternMatchingTestBase.cs (2)
274var type = local.Type; 315Assert.Equal(local.Type, model.GetTypeInfo(reference).Type);
Semantics\PatternMatchingTests_Global.cs (2)
901Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl)).Type.ToTestDisplayString()); 1459Assert.Equal("System.Int32", ((IFieldSymbol)compilation.GetSemanticModel(tree).GetDeclaredSymbol(x1Decl)).Type.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Features (9)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
227symbolType = field.Type;
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
130IFieldSymbol field => field.Type,
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
260(ExpressionSyntax)CSharpSyntaxGenerator.Instance.DefaultExpression(field.Type)));
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
99field.Type,
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
107IsImplicitConversion(compilation, source: parameter.Type, destination: field.Type) &&
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
177var type = namedParameter is IFieldSymbol ? ((IFieldSymbol)namedParameter).Type : ((IPropertySymbol)namedParameter).Type;
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
189var typeParts = element.Type.ToMinimalDisplayParts(semanticModel, position).ToList();
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
94Type.SpecialType: SpecialType.System_Object,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
175var type = elements[i].Type;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\AccessCheckTests.cs (13)
751ITypeSymbol karrayType = (classA.GetMembers("karray").Single() as IFieldSymbol).Type; 752ITypeSymbol aarrayType = (classA.GetMembers("aarray").Single() as IFieldSymbol).Type; 753ITypeSymbol kptrType = (classA.GetMembers("kptr").Single() as IFieldSymbol).Type; 754ITypeSymbol aptrType = (classA.GetMembers("aptr").Single() as IFieldSymbol).Type; 755ITypeSymbol kinreturnfuncptrType = (classA.GetMembers("kinreturnfuncptr").Single() as IFieldSymbol).Type; 756ITypeSymbol kinparamfuncptr1Type = (classA.GetMembers("kinparamfuncptr1").Single() as IFieldSymbol).Type; 757ITypeSymbol kinparamfuncptr2Type = (classA.GetMembers("kinparamfuncptr2").Single() as IFieldSymbol).Type; 758ITypeSymbol afuncptrType = (classA.GetMembers("afuncptr").Single() as IFieldSymbol).Type; 759ITypeSymbol kenumType = (classA.GetMembers("kenum").Single() as IFieldSymbol).Type; 760ITypeSymbol aenumType = (classA.GetMembers("aenum").Single() as IFieldSymbol).Type; 764ITypeSymbol unknownType = (classA.GetMembers("unknowntype").Single() as IFieldSymbol).Type; 915Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_Pointer.Type, Outer)); 916Assert.False(compilation1.IsSymbolAccessibleWithin(Outer_Pointer.Type, Other));
Semantics\UnsafeTests.cs (2)
8238Assert.Equal(intPointerType.GetPublicSymbol(), ((IFieldSymbol)receiverSymbol).Type); 8296Assert.Equal(intPointerType.GetPublicSymbol(), ((IFieldSymbol)receiverSymbol).Type);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (49)
Compilation\SemanticModelAPITests.cs (5)
797Assert.Equal<ISymbol>(abType, xSym.Type); 4504Assert.Equal(SpecialType.System_String, type.TupleElements[0].Type.SpecialType); 4505Assert.Equal(SpecialType.System_Int32, type.TupleElements[1].Type.SpecialType); 4582Assert.Equal(TypeKind.Class, type.TupleElements[0].Type.TypeKind); 4583Assert.Equal(TypeKind.Class, type.TupleElements[1].Type.TypeKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
951Assert.Equal("T", fSymbol.Type.Name);
Compilation\SymbolVisitorTests.cs (3)
84symbol.Type.Accept(this); 259symbol.Type.Accept(this); 450symbol.Type.Accept(this, argument);
Symbols\Source\DeclaringSyntaxNodeTests.cs (5)
205CheckDeclaringSyntaxNodes(comp, f.Type, 1); // constructed type C1<int>. 240CheckDeclaringSyntaxNodes(comp, f.Type, 0); 461foreach (ITypeParameterSymbol tp in ((INamedTypeSymbol)f.Type).TypeParameters) 477foreach (ITypeParameterSymbol tp in ((INamedTypeSymbol)f.Type).TypeParameters) 553var constructedC1 = fieldT.Type;
Symbols\Source\NullablePublicAPITests.cs (5)
151var result = member.Type.NullableAnnotation; 153return member.Type.NullableAnnotation; 2787Assert.Equal(PublicNullableAnnotation.Annotated, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation); 2792Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation); 4218Assert.Equal(SpecialType.System_String, ((IFieldSymbol)symbolInfo.Symbol).Type.SpecialType);
Symbols\SymbolEqualityTests.cs (30)
225var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 226var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 249var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 250var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 285var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 286var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 309var type1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 310var type2 = ((IFieldSymbol)comp.GetMember("A.field2")).Type; 344var type1comp1 = ((IFieldSymbol)comp1.GetMember("A.field1")).Type; 345var type1comp2 = ((IFieldSymbol)comp2.GetMember("A.field1")).Type; 346var type2 = ((IFieldSymbol)comp2.GetMember("B.field2")).Type; 376var symbol1 = ((IFieldSymbol)comp.GetMember("A.field1")).Type; 454var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 455var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 485var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 486var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 528var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 529var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 559var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 560var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 630var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 631var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 679var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 680var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 693var prop1Type = field1.Type; 694var prop2Type = field2.Type; 731var type1 = ((IFieldSymbol)model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0])).Type; 732var type2 = ((IFieldSymbol)model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0])).Type; 788var field1Type = field1.Type; // A<T!> 789var field2Type = field2.Type; // A<T!>
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
815return ((IFieldSymbol)symbol).Type;
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
53var tupleElementType = tupleType.TupleElements[i].Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
160var namedType = enumMember.Type as INamedTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (4)
104field.Type.GenerateTypeSyntax(), 115var canUseFieldReference = field.Type != null && !field.Type.Equals(field.ContainingType); 116return EqualsValueClause(ExpressionGenerator.GenerateExpression(generator, field.Type, field.ConstantValue, canUseFieldReference));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
257list = list.Add(TupleElement(element.Type.GenerateTypeSyntax(), name));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1465result.Add(new TypeInferenceInfo(field.Type));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (110)
Utilities\SymbolEquivalenceComparerTests.cs (110)
68Assert.True(SymbolEquivalenceComparer.Instance.Equals(intField1.Type, intField1.Type)); 69Assert.True(SymbolEquivalenceComparer.Instance.Equals(intField1.Type, intField2.Type)); 70Assert.Equal(SymbolEquivalenceComparer.Instance.GetHashCode(intField1.Type), 71SymbolEquivalenceComparer.Instance.GetHashCode(intField2.Type)); 73Assert.True(SymbolEquivalenceComparer.Instance.Equals(intArrayField1.Type, intArrayField1.Type)); 74Assert.True(SymbolEquivalenceComparer.Instance.Equals(intArrayField1.Type, intArrayField2.Type)); 75Assert.Equal(SymbolEquivalenceComparer.Instance.GetHashCode(intArrayField1.Type), 76SymbolEquivalenceComparer.Instance.GetHashCode(intArrayField2.Type)); 78Assert.True(SymbolEquivalenceComparer.Instance.Equals(stringArrayField1.Type, stringArrayField1.Type)); 79Assert.True(SymbolEquivalenceComparer.Instance.Equals(stringArrayField1.Type, stringArrayField2.Type)); 81Assert.True(SymbolEquivalenceComparer.Instance.Equals(intArrayArrayField1.Type, intArrayArrayField1.Type)); 82Assert.True(SymbolEquivalenceComparer.Instance.Equals(intArrayArrayField1.Type, intArrayArrayField2.Type)); 84Assert.True(SymbolEquivalenceComparer.Instance.Equals(intArrayRank2Field1.Type, intArrayRank2Field1.Type)); 85Assert.True(SymbolEquivalenceComparer.Instance.Equals(intArrayRank2Field1.Type, intArrayRank2Field2.Type)); 87Assert.True(SymbolEquivalenceComparer.Instance.Equals(int32Field1.Type, int32Field1.Type)); 88Assert.True(SymbolEquivalenceComparer.Instance.Equals(int32Field1.Type, int32Field2.Type)); 90Assert.False(SymbolEquivalenceComparer.Instance.Equals(intField1.Type, intArrayField1.Type)); 91Assert.False(SymbolEquivalenceComparer.Instance.Equals(intArrayField1.Type, stringArrayField1.Type)); 92Assert.False(SymbolEquivalenceComparer.Instance.Equals(stringArrayField1.Type, intArrayArrayField1.Type)); 93Assert.False(SymbolEquivalenceComparer.Instance.Equals(intArrayArrayField1.Type, intArrayRank2Field1.Type)); 94Assert.False(SymbolEquivalenceComparer.Instance.Equals(intArrayRank2Field1.Type, int32Field1.Type)); 96Assert.True(SymbolEquivalenceComparer.Instance.Equals(int32Field1.Type, intField1.Type)); 141Assert.True(SymbolEquivalenceComparer.Instance.Equals(csharpIntField1.Type, vbIntField1.Type)); 142Assert.True(SymbolEquivalenceComparer.Instance.Equals(csharpIntArrayField1.Type, vbIntArrayField1.Type)); 143Assert.True(SymbolEquivalenceComparer.Instance.Equals(csharpStringArrayField1.Type, vbStringArrayField1.Type)); 144Assert.True(SymbolEquivalenceComparer.Instance.Equals(csharpIntArrayArrayField1.Type, vbIntArrayArrayField1.Type)); 145Assert.True(SymbolEquivalenceComparer.Instance.Equals(csharpInt32Field1.Type, vbInt32Field1.Type)); 147Assert.False(SymbolEquivalenceComparer.Instance.Equals(csharpIntField1.Type, vbIntArrayField1.Type)); 148Assert.False(SymbolEquivalenceComparer.Instance.Equals(vbIntArrayField1.Type, csharpStringArrayField1.Type)); 149Assert.False(SymbolEquivalenceComparer.Instance.Equals(csharpStringArrayField1.Type, vbIntArrayArrayField1.Type)); 150Assert.False(SymbolEquivalenceComparer.Instance.Equals(vbIntArrayArrayField1.Type, csharpIntArrayRank2Field1.Type)); 151Assert.False(SymbolEquivalenceComparer.Instance.Equals(csharpIntArrayRank2Field1.Type, vbInt32Field1.Type)); 153Assert.True(SymbolEquivalenceComparer.Instance.Equals(csharpInt32Field1.Type, vbIntField1.Type)); 155Assert.False(SymbolEquivalenceComparer.Instance.Equals(vbIntField1.Type, csharpIntArrayField1.Type)); 156Assert.False(SymbolEquivalenceComparer.Instance.Equals(csharpIntArrayField1.Type, vbStringArrayField1.Type)); 157Assert.False(SymbolEquivalenceComparer.Instance.Equals(vbStringArrayField1.Type, csharpIntArrayArrayField1.Type)); 158Assert.False(SymbolEquivalenceComparer.Instance.Equals(csharpIntArrayArrayField1.Type, vbIntArrayRank2Field1.Type)); 159Assert.False(SymbolEquivalenceComparer.Instance.Equals(vbIntArrayRank2Field1.Type, csharpInt32Field1.Type)); 161Assert.True(SymbolEquivalenceComparer.Instance.Equals(vbInt32Field1.Type, csharpIntField1.Type)); 293var goo_intInstantiation1 = intInstantiation1.Type.GetMembers("goo").Single(); 294var goo_stringInstantiation = stringInstantiation.Type.GetMembers("goo").Single(); 295var goo_instanceInstantiation = instanceInstantiation.Type.GetMembers("goo").Single(); 296var goo_intInstantiation2 = intInstantiation2.Type.GetMembers("goo").Single(); 1346var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1347var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1348var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1349var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1350var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1351var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1352var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1353var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1410var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1411var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1412var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1413var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1414var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1415var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1416var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1417var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1473var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1474var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1475var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1476var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1477var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1478var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1479var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1480var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1536var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1537var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1538var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1539var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1540var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1541var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1542var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1543var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Workspaces\TryFindSourceDefinitionTests.vb (2)
61Dim fieldType = field.Type 105Dim fieldType = field.Type
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
82Visit(symbol.Type);
Microsoft.CodeAnalysis.Features (19)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
122return !fieldSymbol.Type.IsStructType();
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
107IFieldSymbol fieldSymbol => fieldSymbol.Type,
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
286tupleType.TupleElements.Select(p => p.Type)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
2396TypesEquivalent(oldField.Type, newField.Type, exact);
EncapsulateField\AbstractEncapsulateFieldService.cs (2)
348accessibility: ComputeAccessibility(accessibility, field.Type), 350type: field.Type,
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
625_service.IsConversionImplicit(_semanticDocument.SemanticModel.Compilation, parameterType, field.Type);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
701IsImplicitConversion(compilation, source: parameter.Type, destination: field.Type) &&
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
38=> symbol.Type.Accept(this);
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
33=> Visit(symbol.Type);
Shared\Utilities\ExtractTypeHelpers.cs (1)
216return DoesTypeReferenceTypeParameter(field.Type, typeParameter, checkedTypes);
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
172if (symbol.Type.IsMutableValueType() != false)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
158if (member is not IFieldSymbol fieldSymbol || fieldSymbol.Type.SpecialType != SpecialType.None)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
412if (!getterField.IsReadOnly && getterField.Type.IsMutableValueType() != false) 424if (!property.Type.Equals(getterField.Type))
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
549_service.IsConversionImplicit(_document.SemanticModel.Compilation, parameterType, field.Type);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
29.Where(f => includeMemberType(f.Type))
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
87generator.TypeExpression(symbol.Type),
Microsoft.CodeAnalysis.Test.Utilities (4)
CompilationVerifier.cs (1)
748.Select(f => $"{((IFieldSymbol)f.GetISymbol()).Type.ToString()} {f.Name}")
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (3)
142AssignTo(initializedField, initializedField.Type, fieldsSourceTypes, initializer.Value); 153if (HasMoreSpecificSourceType(field, field.Type, fieldsSourceTypes, out var mostSpecificSourceType)) 248AssignTo(targetField, targetField.Type, fieldsSourceTypes, sourceType);
Microsoft.CodeAnalysis.VisualBasic (4)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (2)
45symbol.Type.Accept(Me.NotFirstVisitor()) 58AddConstantValue(symbol.Type, symbol.ConstantValue, preferNumericValueOrExpandedFlagsForEnum:=IsEnumMember(symbol))
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
402element.Type.Accept(Me.NotFirstVisitor)
Symbols\FieldSymbol.vb (1)
470Private ReadOnly Property IFieldSymbol_Type As ITypeSymbol Implements IFieldSymbol.Type
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
136Dim namedType = TryCast(enumMember.Type, INamedTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (4)
88SyntaxFactory.SimpleAsClause(field.Type.GenerateTypeSyntax()), 96Dim canUseFieldReference = field.Type IsNot Nothing AndAlso Not field.Type.Equals(field.ContainingType) 97Return SyntaxFactory.EqualsValue(ExpressionGenerator.GenerateExpression(generator, field.Type, field.ConstantValue, canUseFieldReference))
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
91Dim symbolType = If(TryCast(symbol, IFieldSymbol)?.Type,
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\SemanticModelAPITests.vb (2)
4660Assert.Equal("System.String", symbol.Type.ToTestDisplayString()) 4795Assert.Equal("System.String", symbol.Type.ToTestDisplayString())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (8)
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
320If fieldSymbol.Type.IsDelegateType AndAlso 321fieldSymbol.Type.IsImplicitlyDeclared AndAlso 322DirectCast(fieldSymbol.Type, INamedTypeSymbol).AssociatedSymbol IsNot Nothing Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
136Dim namedType = TryCast(enumMember.Type, INamedTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (4)
88SyntaxFactory.SimpleAsClause(field.Type.GenerateTypeSyntax()), 96Dim canUseFieldReference = field.Type IsNot Nothing AndAlso Not field.Type.Equals(field.ContainingType) 97Return SyntaxFactory.EqualsValue(ExpressionGenerator.GenerateExpression(generator, field.Type, field.ConstantValue, canUseFieldReference))
Microsoft.CodeAnalysis.Workspaces (9)
Editing\SyntaxGenerator.cs (1)
146TypeExpression(field.Type),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
328IFieldSymbol fieldSymbol => fieldSymbol.Type, 616IFieldSymbol fieldSymbol => fieldSymbol.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
51return symbol.Type.Accept(this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
44elementTypes.Add(element.Type);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
453if (!AreEquivalent(xElement.Type, yElement.Type, equivalentTypesWithDifferingAssemblies))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
605field.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
90IFieldSymbol field => field.Type,
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
FindReferencesTests.cs (1)
131var result = (await SymbolFinder.FindReferencesAsync(symbol.Type, solution)).ToList();
SymbolKeyTests.cs (5)
359TestRoundTrip(GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(fs => fs.Type), compilation); 377TestRoundTrip(GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(fs => fs.Type), compilation, s => s.ToDisplayString()); 685var refSymbols = GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(f => f.Type).ToList(); 704var symbols = GetDeclaredSymbols(compilation).OfType<IFieldSymbol>().Select(f => f.Type).ToList(); 1257var fields = GetDeclaredSymbols(comp).OfType<IFieldSymbol>().Select(f => f.Type);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
659if (IsBaseOrIdentity(fs.Type, loggerSymbol))
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
151classifiedMembers = ClassifyMember(classifiedMembers, field, field.Type);
Microsoft.Gen.Logging (2)
Parsing\Parser.cs (1)
652IFieldSymbol fs => fs.Type,
Parsing\Parser.Records.cs (1)
67IFieldSymbol field => new(field.Name, field.Type, Property: null),
Microsoft.Gen.Metrics (3)
Parser.cs (3)
708kind = fieldSymbol!.Type.TypeKind; 709specialType = fieldSymbol.Type.SpecialType; 710typeSymbol = fieldSymbol.Type;
Microsoft.Gen.MetricsReports (3)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (3)
708kind = fieldSymbol!.Type.TypeKind; 709specialType = fieldSymbol.Type.SpecialType; 710typeSymbol = fieldSymbol.Type;
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
171IFieldSymbol field => field.Type,
Microsoft.Interop.SourceGeneration (1)
TypeSymbolExtensions.cs (1)
160if (!IsBlittableWorker(field.Type, seenTypes.Add(type), compilation, isBlittable))
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService_Prototype.cs (1)
481builder.Append(GetAsStringForCodeTypeRef(symbol.Type));
ObjectBrowser\DescriptionBuilder.cs (1)
480AddTypeLink(fieldSymbol.Type, LinkFlags.None);
Progression\CSharpProgressionLanguageService.cs (1)
118case IFieldSymbol f: return f.ContainingType.TypeKind == TypeKind.Enum ? null : f.Type;
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
122AppendType(builder, symbol.Type, flags)
ObjectBrowser\DescriptionBuilder.vb (1)
231AddTypeLink(fieldSymbol.Type, LinkFlags.None)
System.Text.Json.SourceGeneration (6)
Helpers\RoslynExtensions.cs (5)
69.Select(e => compilation.EraseCompileTimeMetadata(e.Type)) 216return member is IFieldSymbol fs ? fs.Type : ((IPropertySymbol)member).Type; 284if (field.Type.IsNullableType()) 292isGetterNonNullable = IsOutputTypeNonNullable(field, field.Type); 293isSetterNonNullable = IsInputTypeNonNullable(field, field.Type);
JsonSourceGenerator.Parser.cs (1)
965memberType: fieldInfo.Type,