13 types derived from NamedTypeSymbol
Microsoft.CodeAnalysis.CSharp (13)
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
15internal abstract class AnonymousTypeOrDelegatePublicSymbol : NamedTypeSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (1)
29internal abstract class AnonymousTypeOrDelegateTemplateSymbol : NamedTypeSymbol
Symbols\ErrorTypeSymbol.cs (1)
19internal abstract partial class ErrorTypeSymbol : NamedTypeSymbol
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
29internal abstract class PENamedTypeSymbol : NamedTypeSymbol
Symbols\Source\SourceMemberContainerSymbol.cs (1)
27internal abstract partial class SourceMemberContainerTypeSymbol : NamedTypeSymbol
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
16internal sealed class SynthesizedReadOnlyListEnumeratorTypeSymbol : NamedTypeSymbol
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
54internal sealed class SynthesizedReadOnlyListTypeSymbol : NamedTypeSymbol
Symbols\Synthesized\SynthesizedContainer.cs (1)
21internal abstract class SynthesizedContainer : NamedTypeSymbol
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
28internal abstract class SynthesizedEmbeddedAttributeSymbolBase : NamedTypeSymbol
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
19internal sealed class SynthesizedHotReloadExceptionSymbol : NamedTypeSymbol
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
23internal sealed class SynthesizedInlineArrayTypeSymbol : NamedTypeSymbol
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (1)
18internal sealed partial class SynthesizedPrivateImplementationDetailsType : NamedTypeSymbol
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
23internal abstract class WrappedNamedTypeSymbol : NamedTypeSymbol
3203 references to NamedTypeSymbol
Microsoft.CodeAnalysis.CSharp (3058)
Binder\Binder.cs (8)
422internal NamedTypeSymbol? ContainingType 431NamedTypeSymbol namedType => namedType, 453return ((NamedTypeSymbol)containingMember).IsScriptClass; 488internal virtual NamedTypeSymbol? ParamsCollectionTypeInProgress => null; 638NamedTypeSymbol? containingType, 704NamedTypeSymbol? containingType, 781NamedTypeSymbol within, 790NamedTypeSymbol within,
Binder\Binder.ValueChecks.cs (1)
4550if (LocalRewriter.ShouldUseRuntimeHelpersCreateSpan(expr, ((NamedTypeSymbol)parameter.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type))
Binder\Binder.WithQueryLambdaParametersBinder.cs (2)
74var receiverType = receiver.Type as NamedTypeSymbol;
Binder\Binder_AnonymousTypes.cs (2)
107NamedTypeSymbol anonymousType = manager.ConstructAnonymousTypeSymbol(descriptor); 201return ((NamedTypeSymbol)member).IsScriptClass;
Binder\Binder_Attributes.cs (19)
30ImmutableArray<Binder> binders, ImmutableArray<AttributeSyntax> attributesToBind, Symbol ownerSymbol, NamedTypeSymbol[] boundAttributeTypes, 55var boundTypeSymbol = (NamedTypeSymbol)boundType.Type; 74ImmutableArray<NamedTypeSymbol> boundAttributeTypes, 91NamedTypeSymbol boundAttributeType = boundAttributeTypes[i]; 127AttributeSyntax node, NamedTypeSymbol boundAttributeType, 138internal BoundAttribute BindAttribute(AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics) 155private static BoundAttribute BindAttributeCore(Binder binder, AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics) 168NamedTypeSymbol attributeTypeForBinding = attributeType; 174if (errorType.CandidateSymbols.Length == 1 && errorType.CandidateSymbols[0] is NamedTypeSymbol) 176attributeTypeForBinding = (NamedTypeSymbol)errorType.CandidateSymbols[0]; 284var attributeType = (NamedTypeSymbol)boundAttribute.Type; 411protected bool IsAttributeConditionallyOmitted(NamedTypeSymbol attributeType, SyntaxTree? syntaxTree, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 432var baseType = attributeType.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 451NamedTypeSymbol attributeType, 514private BoundAssignmentOperator BindNamedAttributeArgument(AttributeArgumentSyntax namedArgument, NamedTypeSymbol attributeType, BindingDiagnosticBag diagnostics) 592private Symbol BindNamedAttributeArgumentName(AttributeArgumentSyntax namedArgument, NamedTypeSymbol attributeType, BindingDiagnosticBag diagnostics, out bool wasError, out LookupResultKind resultKind) 607private TypeSymbol BindNamedAttributeArgumentType(AttributeArgumentSyntax namedArgument, Symbol namedArgumentNameSymbol, NamedTypeSymbol attributeType, BindingDiagnosticBag diagnostics)
Binder\Binder_Await.cs (1)
413var INotifyCompletion = GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_INotifyCompletion, diagnostics, node);
Binder\Binder_Conversions.cs (41)
114NamedTypeSymbol.ReportTupleNamesMismatchesIfAny(destination, sourceTuple, diagnostics); 200BindUnconvertedInterpolatedExpressionToHandlerType(source, (NamedTypeSymbol)destination, diagnostics), 537.AsMember((NamedTypeSymbol)destination) 538.Construct([((NamedTypeSymbol)source.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]]) 613var sourceElementType = ((NamedTypeSymbol)source).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type; 614var destinationElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type; 646((NamedTypeSymbol)parameter.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type.Equals(typeArgument.Type, TypeCompareKind.ConsiderEverything) && 648((NamedTypeSymbol)method.ReturnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type.Equals(((NamedTypeSymbol)arg.destination).TypeParameters[0], TypeCompareKind.ConsiderEverything)); 656Debug.Assert(((NamedTypeSymbol)readOnlySpanType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].SpecialType is SpecialType.System_Char); 662TryFindSingleMethod(memoryExtensionsType.GetSymbol<NamedTypeSymbol>(), WellKnownMemberNames.AsSpanMethodName, 0, 783return binder.BindClassCreationExpression(syntax, type.Name, typeNode: syntax, (NamedTypeSymbol)type, arguments, diagnostics, initializerOpt, wasTargetTyped: true); 787return binder.BindDelegateCreationExpression(syntax, (NamedTypeSymbol)type, arguments, initializerOpt, wasTargetTyped: true, diagnostics); 789return binder.BindInterfaceCreationExpression(syntax, (NamedTypeSymbol)type, diagnostics, typeNode: syntax, arguments, initializerOpt, wasTargetTyped: true); 855var namedType = (NamedTypeSymbol)targetType; 885if (targetType is NamedTypeSymbol namedType && 886HasParamsCollectionTypeInProgress(namedType, out NamedTypeSymbol? inProgress, out MethodSymbol? inProgressConstructor)) 1034NamedTypeSymbol namedType, 1042var targetTypeOriginalDefinition = namedType.OriginalDefinition; 1061var parameterType = (NamedTypeSymbol)collectionBuilderMethod.Parameters[0].Type; 1087if (targetType is NamedTypeSymbol namedType) 1115if (targetType is NamedTypeSymbol namedType) 1215private bool HasParamsCollectionTypeInProgress(NamedTypeSymbol toCheck, 1216[NotNullWhen(returnValue: true)] out NamedTypeSymbol? inProgress, 1242NamedTypeSymbol? namedType = targetType as NamedTypeSymbol; 1833NamedTypeSymbol targetType, 1894var spanTypeArg = ((NamedTypeSymbol)methodWithTargetTypeParameters.Parameters[0].Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type; 2222var boundLambda = unboundLambda.Bind((NamedTypeSymbol)destination, isExpressionTree: destination.IsGenericOrNonGenericExpressionType(out _)).WithInAnonymousFunctionConversion(); 2311var delegateType = targetType.GetDelegateType(); 2443NamedTypeSymbol targetType = (NamedTypeSymbol)destinationWithoutNullable; 2446NamedTypeSymbol.ReportTupleNamesMismatchesIfAny(targetType, sourceTuple, diagnostics); 2454if (sourceTuple.Type is NamedTypeSymbol { IsTupleType: true } sourceType) 2811Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 2817NamedTypeSymbol { DelegateInvokeMethod: { } invokeMethod } => invokeMethod, 3052NamedTypeSymbol delegateType, 3198var underlyingType = ((NamedTypeSymbol)destination).EnumUnderlyingType;
Binder\Binder_Crefs.cs (12)
410NamedTypeSymbol? constructorType = null; 414NamedTypeSymbol? containerType = containerOpt as NamedTypeSymbol; 432NamedTypeSymbol? binderContainingType = this.ContainingType; 582NamedTypeSymbol namedType = (NamedTypeSymbol)type; 605private static bool IsNestedTypeOfUnconstructedGenericType(NamedTypeSymbol type) 607NamedTypeSymbol containing = type.ContainingType; 737NamedTypeSymbol? constructedCandidateType = constructedCandidate as NamedTypeSymbol; 921Debug.Assert(symbol is NamedTypeSymbol); 922symbol = ((NamedTypeSymbol)symbol).Construct(typeArgumentsWithAnnotations.ToImmutableAndFree());
Binder\Binder_Deconstruct.cs (4)
126var voidType = GetSpecialType(SpecialType.System_Void, diagnostics, node); 532return NamedTypeSymbol.CreateTuple( 582var type = NamedTypeSymbol.CreateTuple(
Binder\Binder_Expressions.cs (76)
51var containingType = memberOpt?.ContainingType; 225internal NamedTypeSymbol CreateErrorType(string name = "") 415var delegateType = expr.GetInferredDelegateType(ref useSiteInfo); 978var tupleType = NamedTypeSymbol.CreateTuple( 1056NamedTypeSymbol tupleTypeOpt = null; 1064tupleTypeOpt = NamedTypeSymbol.CreateTuple(node.Location, elements, locations, elementNames, 1070NamedTypeSymbol.VerifyTupleTypePresent(elements.Length, node, this.Compilation, diagnostics); 1204if (name == null || NamedTypeSymbol.IsTupleElementNameReserved(name) != -1) 1632symbol = ConstructNamedTypeUnlessTypeArgumentOmitted(node, (NamedTypeSymbol)symbol, typeArgumentList, typeArgumentsWithAnnotations, diagnostics); 1659var type = BindNativeIntegerSymbolIfAny(identifier, diagnostics); 1730if (symbol.ContainingSymbol is NamedTypeSymbol { OriginalDefinition: var symbolContainerDefinition } && 1738NamedTypeSymbol baseToCheck = containingTypeDefinition.BaseTypeNoUseSiteDiagnostics; 1911var currentType = this.ContainingType; 2091primaryCtor.ContainingSymbol is NamedTypeSymbol { IsRecord: false, IsRecordStruct: false } || 2258var currentType = this.ContainingType; 2260NamedTypeSymbol declaringType = member.ContainingType; 2321private BoundExpression TryBindInteractiveReceiver(SyntaxNode syntax, NamedTypeSymbol memberDeclaringType) 2472private BoundThisReference ThisReference(SyntaxNode node, NamedTypeSymbol thisTypeOpt, bool hasErrors = false, bool wasCompilerGenerated = false) 2572NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node); 2652NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node); 2679NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, operand); 2779!MethodGroupConversionDoesNotExistOrHasErrors((BoundMethodGroup)operand, (NamedTypeSymbol)targetType, syntax.Location, diagnostics, out _)) 3696Debug.Assert(handlerType is NamedTypeSymbol { IsInterpolatedStringHandlerType: true }); 3890(NamedTypeSymbol)handlerType, 4555var spanType = GetWellKnownType(WellKnownType.System_Span_T, diagnostics, node); 4776NamedTypeSymbol containingType = constructor.ContainingType; 4797NamedTypeSymbol initializerType = containingType; 4913NamedTypeSymbol initializerType, 4936NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 5055static void validateRecordCopyConstructor(MethodSymbol constructor, NamedTypeSymbol baseType, MethodSymbol resultMember, Location errorLocation, BindingDiagnosticBag diagnostics) 5157return BindClassCreationExpression(node, (NamedTypeSymbol)type, GetName(node.Type), diagnostics, originalType); 5160return BindDelegateCreationExpression(node, (NamedTypeSymbol)type, diagnostics); 5163return BindInterfaceCreationExpression(node, (NamedTypeSymbol)type, diagnostics); 5281private BoundExpression BindDelegateCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics) 5290private BoundExpression BindDelegateCreationExpression(SyntaxNode node, NamedTypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped, BindingDiagnosticBag diagnostics) 5402var sourceDelegate = (NamedTypeSymbol)argument.Type; 5459private BoundExpression BindClassCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, string typeName, BindingDiagnosticBag diagnostics, TypeSymbol initializerType = null) 5494NamedTypeSymbol type, 6251NamedTypeSymbol collectionsIEnumerableType = this.GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, node); 6583NamedTypeSymbol containingType = this.ContainingType; 6617NamedTypeSymbol type, 6713NamedTypeSymbol type, 6798NamedTypeSymbol type, 6855private BoundObjectInitializerExpressionBase MakeBoundInitializerOpt(SyntaxNode typeNode, NamedTypeSymbol type, InitializerExpressionSyntax initializerSyntaxOpt, TypeSymbol initializerTypeOpt, BindingDiagnosticBag diagnostics) 6868private BoundExpression BindInterfaceCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics) 6877private BoundExpression BindInterfaceCreationExpression(SyntaxNode node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped) 6891NamedTypeSymbol coClassType = type.ComImportCoClass; 6903private BoundExpression BindComImportCoClassCreationExpression(SyntaxNode node, NamedTypeSymbol interfaceType, NamedTypeSymbol coClassType, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped) 6986NamedTypeSymbol interfaceType, 6987NamedTypeSymbol coClassType, 7096NamedTypeSymbol typeContainingConstructors, 7223private ImmutableArray<MethodSymbol> GetAccessibleConstructorsForOverloadResolution(NamedTypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 7229private ImmutableArray<MethodSymbol> GetAccessibleConstructorsForOverloadResolution(NamedTypeSymbol type, bool allowProtectedConstructorsOfBaseType, out ImmutableArray<MethodSymbol> allInstanceConstructors, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 7236type = type.GetNonErrorGuess() as NamedTypeSymbol ?? type; 7243private static ConstantValue FoldParameterlessValueTypeConstructor(NamedTypeSymbol type) 7351var type = GetWellKnownType(WellKnownType.System_ReadOnlySpan_T, diagnostics, node).Construct(GetSpecialType(SpecialType.System_Byte, diagnostics, node)); 7786var type = (NamedTypeSymbol)sym; 8101var namedType = ((NamedTypeSymbol)type).ConstructedFrom; 8292var type = (NamedTypeSymbol)symbol; 8521NamedTypeSymbol type = fieldSymbol.ContainingType; 8622NamedTypeSymbol enumType = null; 8642enumType = (NamedTypeSymbol)fieldType; 8647NamedTypeSymbol underlyingType = enumType.EnumUnderlyingType; 8666var containingType = this.ContainingType; 9371var int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node); 9443NamedTypeSymbol int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node); 10461internal NamedTypeSymbol? GetMethodGroupDelegateType(BoundMethodGroup node) 10790internal NamedTypeSymbol? GetMethodGroupOrLambdaDelegateType( 10849var delegateType = Compilation.GetWellKnownType(wkDelegateType); 10882static bool checkConstraints(CSharpCompilation compilation, ConversionsBase conversions, NamedTypeSymbol delegateType, ImmutableArray<TypeWithAnnotations> typeArguments)
Binder\Binder_Initializers.cs (1)
207Debug.Assert(scriptClassBinder.ContainingMemberOrLambda is NamedTypeSymbol { IsScriptClass: true });
Binder\Binder_InterpolatedString.cs (15)
41var stringType = GetSpecialType(SpecialType.System_String, diagnostics, node); 55var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node); 264return BindUnconvertedInterpolatedExpressionToFactory(unconvertedInterpolatedString, parts, (NamedTypeSymbol)unconvertedInterpolatedString.Type, factoryMethod: "Format", unconvertedInterpolatedString.Type, diagnostics); 284var interpolatedStringHandlerType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler); 334NamedTypeSymbol factoryType, 450var interpolatedStringHandlerType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler); 517var @string = GetSpecialType(SpecialType.System_String, diagnostics, rootSyntax); 557NamedTypeSymbol interpolatedStringHandlerType, 576NamedTypeSymbol interpolatedStringHandlerType, 603NamedTypeSymbol interpolatedStringHandlerType, 635NamedTypeSymbol interpolatedStringHandlerType, 711var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, syntax); 722var boolType = GetSpecialType(SpecialType.System_Boolean, diagnostics, syntax); 817static void populateArguments(SyntaxNode syntax, ImmutableArray<BoundInterpolatedStringArgumentPlaceholder> additionalConstructorArguments, int baseStringLength, int numFormatHoles, NamedTypeSymbol intType, ArrayBuilder<BoundExpression> argumentsBuilder) 853var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, unconvertedInterpolatedString.Syntax);
Binder\Binder_Invocation.cs (7)
340NamedTypeSymbol delegateType; 628NamedTypeSymbol delegateType) 1105NamedTypeSymbol delegateTypeOpt, 1899private static NamedTypeSymbol GetDelegateType(BoundExpression expr) 1903var type = expr.Type as NamedTypeSymbol; 2042var discarded = unboundArgument.Bind((NamedTypeSymbol)parameterType, isExpressionTree: false);
Binder\Binder_Lookup.cs (66)
189this.LookupMembersInInterface(result, (NamedTypeSymbol)type, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteInfo); 700var namedType = (NamedTypeSymbol)symbol; 811PooledHashSet<NamedTypeSymbol> visited = null; 821NamedTypeSymbol namedType = currentType as NamedTypeSymbol; 875NamedTypeSymbol type, 912NamedTypeSymbol idictSymbol, iroDictSymbol, iListSymbol, iCollectionSymbol, inccSymbol, inpcSymbol; 916foreach (var iface in type.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 957private void GetWellKnownWinRTMemberInterfaces(out NamedTypeSymbol idictSymbol, out NamedTypeSymbol iroDictSymbol, out NamedTypeSymbol iListSymbol, out NamedTypeSymbol iCollectionSymbol, out NamedTypeSymbol inccSymbol, out NamedTypeSymbol inpcSymbol) 967private static bool ShouldAddWinRTMembersForInterface(NamedTypeSymbol iface, NamedTypeSymbol idictSymbol, NamedTypeSymbol iroDictSymbol, NamedTypeSymbol iListSymbol, NamedTypeSymbol iCollectionSymbol, NamedTypeSymbol inccSymbol, NamedTypeSymbol inpcSymbol) 969var iFaceOriginal = iface.OriginalDefinition; 1014NamedTypeSymbol type, 1036private static ImmutableArray<NamedTypeSymbol> GetBaseInterfaces(NamedTypeSymbol type, ConsList<TypeSymbol> basesBeingResolved, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1045return ImmutableArray<NamedTypeSymbol>.Empty; 1052return ImmutableArray<NamedTypeSymbol>.Empty; 1068var cycleGuard = ConsList<NamedTypeSymbol>.Empty.Prepend(type.OriginalDefinition); 1072var result = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 1073var visited = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.ConsiderEverything); 1089static void addAllInterfaces(NamedTypeSymbol @interface, HashSet<NamedTypeSymbol> visited, ArrayBuilder<NamedTypeSymbol> result, ConsList<TypeSymbol> basesBeingResolved, ConsList<NamedTypeSymbol> cycleGuard) 1091NamedTypeSymbol originalDefinition; 1097ImmutableArray<NamedTypeSymbol> baseInterfaces = @interface.GetDeclaredInterfaces(basesBeingResolved); 1104var baseInterface = baseInterfaces[i]; 1117ImmutableArray<NamedTypeSymbol> interfaces, 1130HashSet<NamedTypeSymbol> seenInterfaces = null; 1133seenInterfaces = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.IgnoringNullable); 1136foreach (NamedTypeSymbol baseInterface in interfaces) 1150private void LookupMembersInInterface(LookupResult current, NamedTypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1187private static bool IsDerivedType(NamedTypeSymbol baseType, NamedTypeSymbol derivedType, ConsList<TypeSymbol> basesBeingResolved, CSharpCompilation compilation, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1193for (NamedTypeSymbol b = derivedType.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo); (object)b != null; b = b.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1200PooledHashSet<NamedTypeSymbol> visited = null; 1202for (var b = (NamedTypeSymbol)derivedType.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, compilation, ref visited); 1204b = (NamedTypeSymbol)b.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, compilation, ref visited)) 1297return nsOrType.GetTypeMembers(name).Cast<NamedTypeSymbol, Symbol>(); 1301return ((NamedTypeSymbol)nsOrType).GetEarlyAttributeDecodingMembers(name); 1325return ((NamedTypeSymbol)nsOrType).GetEarlyAttributeDecodingMembers(); 1339while (symbol is not null and not NamedTypeSymbol { IsFileLocal: true }) 1356var symbolFileIdentifier = ((NamedTypeSymbol)symbol).AssociatedFileIdentifier; 1772NamedTypeSymbol namedType = (NamedTypeSymbol)symbol; 1972private void AddWinRTMembersLookupSymbolsInfo(LookupSymbolsInfo result, NamedTypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType) 1974NamedTypeSymbol idictSymbol, iroDictSymbol, iListSymbol, iCollectionSymbol, inccSymbol, inpcSymbol; 1978foreach (var iface in type.AllInterfacesNoUseSiteDiagnostics) 1989PooledHashSet<NamedTypeSymbol> visited = null; 1998NamedTypeSymbol namedType = type as NamedTypeSymbol; 2024foreach (var baseInterface in type.AllInterfacesNoUseSiteDiagnostics) 2040NamedTypeSymbol effectiveBaseClass = type.EffectiveBaseClassNoUseSiteDiagnostics; 2043foreach (var baseInterface in type.AllEffectiveInterfacesNoUseSiteDiagnostics)
Binder\Binder_Operators.cs (10)
882return type is NamedTypeSymbol namedType && Compilation.IsReadOnlySpanType(namedType) && 1092var namedType = type as NamedTypeSymbol; 1150NamedTypeSymbol t = (NamedTypeSymbol)signature.Method.ContainingType; 1266private bool HasApplicableBooleanOperator(NamedTypeSymbol containingType, string name, TypeSymbol argumentType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out MethodSymbol @operator) 1269for (var type = containingType; (object)type != null; type = type.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 2818var underlyingType = operand.Type.GetEnumUnderlyingType()!; 2825var upconvertType = upconvertSpecialType == underlyingType.SpecialType ? 4054var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
Binder\Binder_Patterns.cs (9)
224var systemRangeType = GetWellKnownType(WellKnownType.System_Range, diagnostics, node); 383var systemIndexType = GetWellKnownType(WellKnownType.System_Index, diagnostics, node); 1005ShouldUseITupleForRecursivePattern(node, declType, diagnostics, out var iTupleType, out var iTupleGetLength, out var iTupleGetItem)) 1179foundField = CheckIsTupleElement(subpatternSyntax.NameColon.Name, (NamedTypeSymbol)declType, name, i, diagnostics); 1199[NotNullWhen(true)] out NamedTypeSymbol? iTupleType, 1237[NotNullWhen(true)] out NamedTypeSymbol? iTupleType, 1284bool hasBaseInterface(TypeSymbol type, NamedTypeSymbol possibleBaseInterface) 1296private static FieldSymbol? CheckIsTupleElement(SyntaxNode node, NamedTypeSymbol tupleType, string name, int tupleIndex, BindingDiagnosticBag diagnostics) 1401ShouldUseITuple(node, strippedInputType, diagnostics, out var iTupleType, out var iTupleGetLength, out var iTupleGetItem))
Binder\Binder_Query.cs (2)
814NamedTypeSymbol anonymousType = manager.ConstructAnonymousTypeSymbol(typeDescriptor); 1040protected BoundExpression MakeConstruction(CSharpSyntaxNode node, NamedTypeSymbol toCreate, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics)
Binder\Binder_QueryErrors.cs (5)
90var iqueryable_t = Compilation.GetWellKnownType(WellKnownType.System_Linq_IQueryable_T); 96private static bool HasUniqueInterface(TypeSymbol instanceType, NamedTypeSymbol interfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 102private static bool HasUniqueInterface(TypeSymbol instanceType, NamedTypeSymbol interfaceType, ref bool nonUnique, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 105foreach (var i in instanceType.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 128var iqueryable = Compilation.GetWellKnownType(WellKnownType.System_Linq_IQueryable);
Binder\Binder_Statements.cs (8)
2063conversionError(diagnostics, ErrorCode.ERR_ExpressionTreeMustHaveDelegate, ((NamedTypeSymbol)targetType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type); 2106var delegateType = targetType.GetDelegateType(); 2640var boolean = GetSpecialType(SpecialType.System_Boolean, diagnostics, node); 3813NamedTypeSymbol containingType = constructor.ContainingType; 3814NamedTypeSymbol baseType = containingType.BaseTypeNoUseSiteDiagnostics; 3914NamedTypeSymbol baseType = constructor.ContainingType.BaseTypeNoUseSiteDiagnostics; 3976NamedTypeSymbol containingType = constructor.ContainingType; 3977NamedTypeSymbol baseType = containingType.BaseTypeNoUseSiteDiagnostics;
Binder\Binder_Symbols.cs (37)
555var type = (NamedTypeSymbol)constructedType.Type; 570var type = BindPredefinedTypeSymbol(predefinedType, diagnostics); 734return NamedTypeSymbol.CreateTuple(syntax.Location, 790int reserved = NamedTypeSymbol.IsTupleElementNameReserved(name); 809private NamedTypeSymbol BindPredefinedTypeSymbol(PredefinedTypeSyntax node, BindingDiagnosticBag diagnostics) 991private NamedTypeSymbol BindNativeIntegerSymbolIfAny(IdentifierNameSyntax node, BindingDiagnosticBag diagnostics) 1209NamedTypeSymbol unconstructedType = LookupGenericTypeName( 1211NamedTypeSymbol resultType; 1259private NamedTypeSymbol LookupGenericTypeName( 1299NamedTypeSymbol type = lookupResultSymbol as NamedTypeSymbol; 1372private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1568private NamedTypeSymbol ConstructNamedType( 1569NamedTypeSymbol type, 1612((NamedTypeSymbol)left).IsUnboundGenericType; 1619left = ((NamedTypeSymbol)left).OriginalDefinition; 1638var namedTypeRight = right.Symbol as NamedTypeSymbol; 1649internal NamedTypeSymbol GetSpecialType(SpecialType typeId, BindingDiagnosticBag diagnostics, SyntaxNode node) 1654internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, SyntaxNode node, BindingDiagnosticBag diagnostics) 1656NamedTypeSymbol typeSymbol = compilation.GetSpecialType(typeId); 1662internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, Location location, BindingDiagnosticBag diagnostics) 1664NamedTypeSymbol typeSymbol = compilation.GetSpecialType(typeId); 1768internal NamedTypeSymbol GetWellKnownType(WellKnownType type, BindingDiagnosticBag diagnostics, SyntaxNode node) 1777internal NamedTypeSymbol GetWellKnownType(WellKnownType type, BindingDiagnosticBag diagnostics, Location location) 1786internal static NamedTypeSymbol GetWellKnownType(CSharpCompilation compilation, WellKnownType type, BindingDiagnosticBag diagnostics, SyntaxNode node) 1791internal static NamedTypeSymbol GetWellKnownType(CSharpCompilation compilation, WellKnownType type, BindingDiagnosticBag diagnostics, Location location) 1793NamedTypeSymbol typeSymbol = compilation.GetWellKnownType(type); 1803internal NamedTypeSymbol GetWellKnownType(WellKnownType type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1805NamedTypeSymbol typeSymbol = this.Compilation.GetWellKnownType(type); 2202Compilation.IsAttributeType((NamedTypeSymbol)first) && 2203Compilation.IsAttributeType((NamedTypeSymbol)second)) 2266Emit.NoPia.EmbeddedTypesManager.IsValidEmbeddableType((NamedTypeSymbol)singleResult, where, diagnostics.DiagnosticBag); 2522if (symbol is NamedTypeSymbol { IsFileLocal: true }) 2638var forwardedType =
Binder\Binder_TupleOperators.cs (3)
409var tuple = NamedTypeSymbol.CreateTuple(locationOpt: null, 420NamedTypeSymbol nullableT = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, syntax);
Binder\BinderFactory.BinderFactoryVisitor.cs (9)
434private NamedTypeSymbol GetContainerType(Binder binder, CSharpSyntaxNode node) 437var container = containingSymbol as NamedTypeSymbol; 514NamedTypeSymbol container = GetContainerType(outerBinder, baseMethodDeclarationSyntax); 533NamedTypeSymbol container = GetContainerType(outerBinder, basePropertyDeclarationSyntax); 550NamedTypeSymbol container = GetContainerType(outerBinder, eventDeclarationSyntax); 560private Symbol GetMemberSymbol(string memberName, TextSpan memberSpan, NamedTypeSymbol container, SymbolKind kind) 972var scriptClass = compilation.ScriptClass; 1311for (NamedTypeSymbol curr = outerBinder.ContainingType; (object)curr != null; curr = curr.ContainingType)
Binder\DecisionDagBuilder.cs (1)
330var iTupleType = getLengthProperty.ContainingType;
Binder\EarlyWellKnownAttributeBinder.cs (2)
27AttributeSyntax node, NamedTypeSymbol boundAttributeType, 43AttributeSyntax node, NamedTypeSymbol boundAttributeType,
Binder\ExpressionVariableFinder.cs (3)
599NamedTypeSymbol container = _scopeBinder.ContainingType; 620NamedTypeSymbol container = _scopeBinder.ContainingType; 645NamedTypeSymbol container = _scopeBinder.ContainingType;
Binder\ForEachLoopBinder.cs (13)
711nullableValueGetter = nullableValueGetter.AsMember((NamedTypeSymbol)collectionExprType); 835NamedTypeSymbol spanType = GetWellKnownType(wellKnownSpan, diagnostics, collectionExpr.Syntax); 1067NamedTypeSymbol collectionType = (NamedTypeSymbol)builder.CollectionType; 1127moveNextMethod = moveNextAsync.AsMember((NamedTypeSymbol)enumeratorType); 1139builder.CurrentPropertyGetter = currentPropertyGetter.AsMember((NamedTypeSymbol)enumeratorType); 1259NamedTypeSymbol targetInterface = isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable); 1758NamedTypeSymbol implementedIEnumerable = GetIEnumerableOfT(type, isAsync, Compilation, ref useSiteInfo, out foundMultiple, out bool needSupportForRefStructInterfaces); 1787internal static NamedTypeSymbol GetIEnumerableOfT( 1791NamedTypeSymbol implementedIEnumerable = null; 1811private static void GetIEnumerableOfT(ImmutableArray<NamedTypeSymbol> interfaces, bool isAsync, CSharpCompilation compilation, ref NamedTypeSymbol result, ref bool foundMultiple) 1820foreach (NamedTypeSymbol @interface in interfaces)
Binder\ImportChain.cs (2)
116else if (target is NamedTypeSymbol { ContainingAssembly.IsLinked: false } or not NamedTypeSymbol)
Binder\InContainerBinder.cs (3)
54get { return (_container.Kind == SymbolKind.NamedType) && ((NamedTypeSymbol)_container).IsScriptClass; } 59var type = _container as NamedTypeSymbol;
Binder\InMethodBinder.cs (2)
164return ((NamedTypeSymbol)returnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 170return ((NamedTypeSymbol)returnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0];
Binder\InSubmissionClassBinder.cs (3)
26internal InSubmissionClassBinder(NamedTypeSymbol submissionClass, Binder next, CompilationUnitSyntax declarationSyntax, bool inUsings) 52this.LookupMembersInSubmissions(result, (NamedTypeSymbol)Container, _declarationSyntax, _inUsings, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteInfo); 57this.AddMemberLookupSymbolsInfoInSubmissions(result, (NamedTypeSymbol)Container, _inUsings, options, originalBinder);
Binder\LocalBinderFactory.cs (3)
316NamedTypeSymbol namedType when namedType.IsDelegateType() => getDelegateParameters(namedType), 345case NamedTypeSymbol namedType when namedType.IsDelegateType(): 353static ImmutableArray<ParameterSymbol> getDelegateParameters(NamedTypeSymbol delegateType)
Binder\LockBinder.cs (1)
87if (scopeType is not NamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } ||
Binder\ParamsCollectionTypeInProgressBinder.cs (3)
16private readonly NamedTypeSymbol _inProgress; 19internal ParamsCollectionTypeInProgressBinder(NamedTypeSymbol inProgress, Binder next, MethodSymbol? constructorInProgress = null) 28internal override NamedTypeSymbol ParamsCollectionTypeInProgress => _inProgress;
Binder\PatternExplainer.cs (1)
649if (type is NamedTypeSymbol { TypeKind: TypeKind.Enum } e)
Binder\RefSafetyAnalysis.cs (2)
43var type = symbol.ContainingType; 46var def = type.OriginalDefinition;
Binder\Semantics\AccessCheck.cs (40)
39NamedTypeSymbol within, 54NamedTypeSymbol within, 145Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 158return IsNamedTypeAccessible((NamedTypeSymbol)symbol, within, ref useSiteInfo, basesBeingResolved); 223private static bool IsNamedTypeAccessible(NamedTypeSymbol type, Symbol within, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null) 225Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 246var containingType = type.ContainingType; 261Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 281var withinType = within as NamedTypeSymbol; 298NamedTypeSymbol containingType, // the symbol's containing type 307Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 342NamedTypeSymbol containingType, // the symbol's containing type 353var originalContainingType = containingType.OriginalDefinition; 354var withinType = within as NamedTypeSymbol; 416NamedTypeSymbol withinType, 418NamedTypeSymbol originalContainingType, 459var current = withinType.OriginalDefinition; 494NamedTypeSymbol originalContainingType) 496Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 498var withinType = within as NamedTypeSymbol; 514NamedTypeSymbol withinType, 515NamedTypeSymbol originalContainingType) 523var current = withinType.OriginalDefinition; 545NamedTypeSymbol baseType, 553PooledHashSet<NamedTypeSymbol> interfacesLookedAt = null; 554ArrayBuilder<NamedTypeSymbol> baseInterfaces = null; 559interfacesLookedAt = PooledHashSet<NamedTypeSymbol>.GetInstance(); 560baseInterfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 563PooledHashSet<NamedTypeSymbol> visited = null; 605NamedTypeSymbol currentBase = baseInterfaces.Pop(); 635static void getBaseInterfaces(TypeSymbol derived, ArrayBuilder<NamedTypeSymbol> baseInterfaces, PooledHashSet<NamedTypeSymbol> interfacesLookedAt, ConsList<TypeSymbol> basesBeingResolved) 642ImmutableArray<NamedTypeSymbol> declaredInterfaces; 650case NamedTypeSymbol namedType: 659foreach (var @interface in declaredInterfaces) 661NamedTypeSymbol definition = @interface.OriginalDefinition; 696internal static ErrorCode GetProtectedMemberInSealedTypeError(NamedTypeSymbol containingType)
Binder\Semantics\Conversions\Conversions.cs (6)
58Debug.Assert(methodSymbol == ((NamedTypeSymbol)destination).DelegateInvokeMethod); 138if (destination is NamedTypeSymbol { IsInterpolatedStringHandlerType: true }) 280var delegateType = type.GetDelegateType(); 376public Conversion MethodGroupConversion(SyntaxNode syntax, MethodGroup methodGroup, NamedTypeSymbol delegateType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 500var spanType = _binder.GetWellKnownType(WellKnownType.System_Span_T, ref useSiteInfo); 503var spanType_T = spanType.Construct(sourceExpression.ElementType);
Binder\Semantics\Conversions\ConversionsBase.cs (59)
960var d = derivedType as NamedTypeSymbol; 966foreach (var iface in d.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1150HasIdentityConversionInternal(((NamedTypeSymbol)destination.OriginalDefinition).Construct(ImmutableArray.Create(elementType)), destination)) 1477var delegateType = (NamedTypeSymbol)type; 1588private static LambdaConversionResult IsAnonymousFunctionCompatibleWithExpressionTree(UnboundLambda anonymousFunction, NamedTypeSymbol type, CSharpCompilation compilation) 1621var multicastDelegateType = corLibrary.GetSpecialType(SpecialType.System_MulticastDelegate); 1637return IsAnonymousFunctionCompatibleWithExpressionTree(anonymousFunction, (NamedTypeSymbol)type, compilation); 1676else if ((destination as NamedTypeSymbol)?.HasCollectionBuilderAttribute(out _, out _) == true) 1710if (targetType is NamedTypeSymbol { Arity: 1 } namedType 1899private static bool HasIdentityConversionToAny(NamedTypeSymbol type, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> targetTypes) 2580NamedTypeSymbol destinationAgg = (NamedTypeSymbol)destination; 2820var derivedType = this.corLibrary.GetDeclaredSpecialType(SpecialType.System_MulticastDelegate); 2832var sourceDelegate = sourceType.GetInternalDelegateType(); 2838var destinationDelegate = destinationType.GetInternalDelegateType(); 2919var effectiveBaseClass = source.EffectiveBaseClass(ref useSiteInfo); 2954foreach (var i in source.AllEffectiveInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 2979var d = derivedType as NamedTypeSymbol; 2985foreach (var i in d.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 2996internal bool ImplementsVarianceCompatibleInterface(NamedTypeSymbol derivedType, TypeSymbol baseType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3001internal bool HasImplicitConversionToOrImplementsVarianceCompatibleInterface(TypeSymbol typeToCheck, NamedTypeSymbol targetInterfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool needSupportForRefStructInterfaces) 3021private bool IsRefLikeOrAllowsRefLikeTypeImplementingVarianceCompatibleInterface(TypeSymbol typeToCheck, NamedTypeSymbol targetInterfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3035internal bool HasImplicitConversionToOrImplementsVarianceCompatibleInterface(BoundExpression expressionToCheck, NamedTypeSymbol targetInterfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool needSupportForRefStructInterfaces) 3073NamedTypeSymbol? s = source as NamedTypeSymbol; 3074NamedTypeSymbol? d = destination as NamedTypeSymbol; 3092NamedTypeSymbol? s = source as NamedTypeSymbol; 3093NamedTypeSymbol? d = destination as NamedTypeSymbol; 3107private bool HasVariantConversion(NamedTypeSymbol source, NamedTypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3138private ThreeState HasVariantConversionQuick(NamedTypeSymbol source, NamedTypeSymbol destination) 3148NamedTypeSymbol typeSymbol = source.OriginalDefinition; 3157private bool HasVariantConversionNoCycleCheck(NamedTypeSymbol source, NamedTypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3236static bool isTypeIEquatable(NamedTypeSymbol type) 3551for (var type = t.EffectiveBaseClass(ref useSiteInfo); (object)type != null; type = type.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 3603for (var type = t.EffectiveBaseClass(ref useSiteInfo); (object)type != null; type = type.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 3669var sourceType = (NamedTypeSymbol)source; 3670var destinationType = (NamedTypeSymbol)destination; 3671var original = sourceType.OriginalDefinition; 3754foreach (var iface in this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Array).AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 3771if (HasExplicitReferenceConversion(sourceArray.ElementType, ((NamedTypeSymbol)destination).TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo).Type, ref useSiteInfo)) 3791var sourceElement = ((NamedTypeSymbol)source).TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo).Type; 3966var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3973var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3983var sourceElementType = ((NamedTypeSymbol)source).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3984var destinationElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3993var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 4029var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0];
Binder\Semantics\Conversions\UserDefinedConversions.cs (8)
17public static void AddTypesParticipatingInUserDefinedConversion(ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol? ConstrainedToTypeOpt)> result, TypeSymbol type, bool includeBaseTypes, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 94NamedTypeSymbol effectiveBaseClass = typeParameter.EffectiveBaseClass(ref useSiteInfo); 97ImmutableArray<NamedTypeSymbol> interfaces = includeBaseTypes ? 101foreach (NamedTypeSymbol iface in interfaces) 114static void addFromClassOrStruct(ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol? ConstrainedToTypeOpt)> result, bool excludeExisting, TypeSymbol type, bool includeBaseTypes, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 118var namedType = (NamedTypeSymbol)type; 130NamedTypeSymbol t = type.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo);
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (7)
36var d = ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)>.GetInstance(); 74private static void ComputeUserDefinedExplicitConversionTypeSet(TypeSymbol source, TypeSymbol target, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 90ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, 102foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 117foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 128NamedTypeSymbol declaringType, 147NamedTypeSymbol declaringType,
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (9)
80var d = ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)>.GetInstance(); 118private static void ComputeUserDefinedImplicitConversionTypeSet(TypeSymbol s, TypeSymbol t, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 146ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, 255foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 270foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 281NamedTypeSymbol declaringType, 885private NamedTypeSymbol MakeNullableType(TypeSymbol type) 887var nullable = this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Nullable_T); 961var d = ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)>.GetInstance();
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (11)
222ImmutableArray<NamedTypeSymbol> interfaces = default; 231GetUserDefinedBinaryOperatorsFromType(constrainedToTypeOpt, (NamedTypeSymbol)operatorSourceOpt, kind, isChecked, operators); 254var shadowedInterfaces = PooledHashSet<NamedTypeSymbol>.GetInstance(); 256foreach (NamedTypeSymbol @interface in interfaces) 474var underlying = enumType.GetEnumUnderlyingType(); 478var nullableEnum = Compilation.GetOrCreateNullableType(enumType); 479var nullableUnderlying = Compilation.GetOrCreateNullableType(underlying); 887NamedTypeSymbol current = type0 as NamedTypeSymbol; 918NamedTypeSymbol type, 959void getDeclaredOperators(TypeSymbol constrainedToTypeOpt, NamedTypeSymbol type, BinaryOperatorKind kind, string name, ArrayBuilder<BinaryOperatorSignature> operators)
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (9)
18private NamedTypeSymbol MakeNullable(TypeSymbol type) 308var nullableEnum = Compilation.GetOrCreateNullableType(enumType); 391NamedTypeSymbol current = type0 as NamedTypeSymbol; 419ImmutableArray<NamedTypeSymbol> interfaces = default; 431var shadowedInterfaces = PooledHashSet<NamedTypeSymbol>.GetInstance(); 435foreach (NamedTypeSymbol @interface in interfaces) 474NamedTypeSymbol type, 515static void getDeclaredOperators(TypeSymbol constrainedToTypeOpt, NamedTypeSymbol type, UnaryOperatorKind kind, string name, ArrayBuilder<UnaryOperatorSignature> operators)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (64)
59private static readonly ObjectPool<PooledDictionary<NamedTypeSymbol, NamedTypeSymbol>> s_poolInstance 60= PooledDictionary<NamedTypeSymbol, NamedTypeSymbol>.CreatePool(Symbols.SymbolEqualityComparer.IgnoringNullable); 62internal static PooledDictionary<NamedTypeSymbol, NamedTypeSymbol> GetInstance() 135private readonly NamedTypeSymbol _constructedContainingTypeOfMethod; 173NamedTypeSymbol constructedContainingTypeOfMethod, 318NamedTypeSymbol constructedContainingTypeOfMethod, 705var destination = (NamedTypeSymbol)target.Type; 901var destination = (NamedTypeSymbol)formalType.Type; 1059NamedTypeSymbol n => n.DelegateInvokeMethod, 1382var delegateType = target.Type.GetDelegateType(); 1440NamedTypeSymbol n => (n.DelegateInvokeMethod, false), 1541var delegateType = target.Type.GetDelegateType(); 1739return ((NamedTypeSymbol)type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 1779ExactOrBoundsInference(kind, ((NamedTypeSymbol)source.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0], ((NamedTypeSymbol)target.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0], ref useSiteInfo); 1837var namedSource = source.Type as NamedTypeSymbol; 1843var namedTarget = target.Type as NamedTypeSymbol; 1912private void ExactTypeArgumentInference(NamedTypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2080return ((NamedTypeSymbol)target).TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo); 2169var constructedTarget = target as NamedTypeSymbol; 2189var constructedSource = source as NamedTypeSymbol; 2228private bool LowerBoundClassInference(TypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2250NamedTypeSymbol sourceBase = null; 2273private bool LowerBoundInterfaceInference(TypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2291ImmutableArray<NamedTypeSymbol> allInterfaces; 2314NamedTypeSymbol matchingInterface = GetInterfaceInferenceBound(allInterfaces, target); 2323internal static ImmutableArray<NamedTypeSymbol> ModuloReferenceTypeNullabilityDifferences(ImmutableArray<NamedTypeSymbol> interfaces, VarianceKind variance) 2327foreach (var @interface in interfaces) 2331var merged = (NamedTypeSymbol)found.MergeEquivalentTypes(@interface, variance); 2345private void LowerBoundTypeArgumentInference(NamedTypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2572var constructedSource = source as NamedTypeSymbol; 2588var constructedTarget = target as NamedTypeSymbol; 2625private bool UpperBoundClassInference(NamedTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2639var targetBase = target.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 2654private bool UpperBoundInterfaceInference(NamedTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2680ImmutableArray<NamedTypeSymbol> allInterfaces = target.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 2685NamedTypeSymbol bestInterface = GetInterfaceInferenceBound(allInterfaces, source); 2695private void UpperBoundTypeArgumentInference(NamedTypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2961var resultType = functionType.GetInternalDelegateType(); 2964var expressionOfTType = compilation.GetWellKnownType(WellKnownType.System_Linq_Expressions_Expression_T); 3033private TypeWithAnnotations InferReturnType(BoundExpression source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3088var fixedDelegate = (NamedTypeSymbol)GetFixedDelegateOrFunctionPointer(target); 3127private static NamedTypeSymbol GetInterfaceInferenceBound(ImmutableArray<NamedTypeSymbol> interfaces, NamedTypeSymbol target) 3130NamedTypeSymbol matchingInterface = null; 3131foreach (var currentInterface in interfaces)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (31)
203members.All(static m => m.ContainingSymbol is NamedTypeSymbol { BaseTypeNoUseSiteDiagnostics.SpecialType: SpecialType.System_Object })); 369Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> containingTypeMapOpt = null; 717Debug.Assert(unmanagedCallingConventionTypes.All(u => FunctionPointerTypeSymbol.IsCallingConventionModifier((NamedTypeSymbol)u))); 889private static Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> PartitionMembersByContainingType<TMember>(ArrayBuilder<TMember> members) where TMember : Symbol 891Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> containingTypeMap = new Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>>(); 895NamedTypeSymbol containingType = member.ContainingType; 907private static void ClearContainingTypeMap<TMember>(ref Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> containingTypeMapOpt) where TMember : Symbol 1052Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> containingTypeMapOpt, 1116NamedTypeSymbol memberContainingType = member.ContainingType; 1119NamedTypeSymbol otherType = pair.Key; 1428NamedTypeSymbol memberContainingType = member.ContainingType; 1431NamedTypeSymbol otherContainingType = otherMember.ContainingType; 1634if (currentType.IsInterfaceType() && type.IsInterfaceType() && currentType.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo).Contains((NamedTypeSymbol)type)) 1862var resultsByContainingType = PooledDictionary<NamedTypeSymbol, OneOrMany<TMemberResolution>>.GetInstance(); 2793var n1 = t1 as NamedTypeSymbol; 2794var n2 = t2 as NamedTypeSymbol; 3248NamedTypeSymbol d; 3271y = ((NamedTypeSymbol)y).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type; 3350var destination = (NamedTypeSymbol)targetType; 3490return BetterConversionTargetCore(((NamedTypeSymbol)type1).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type, 3491((NamedTypeSymbol)type2).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type, 3504NamedTypeSymbol d1; 3508NamedTypeSymbol d2; 3597private bool IsMethodGroupConversionIncompatibleWithDelegate(BoundMethodGroup node, NamedTypeSymbol delegateType, Conversion conv) 3619NamedTypeSymbol d1; 3623NamedTypeSymbol d2; 4466&& parameters.ParameterTypes[argumentPosition].Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true, IsValueType: true })
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (7)
198NamedTypeSymbol typeContainingConstructor, 199NamedTypeSymbol delegateTypeBeingInvoked, 845NamedTypeSymbol delegateTypeBeingInvoked, 880NamedTypeSymbol delegateTypeBeingInvoked, 928NamedTypeSymbol typeContainingConstructor, 929NamedTypeSymbol delegateTypeBeingInvoked) 1370parameter.Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true };
Binder\Semantics\SemanticFacts.cs (2)
25NamedTypeSymbol within, 26NamedTypeSymbol throughTypeOpt = null)
Binder\UsingStatementBinder.cs (4)
238NamedTypeSymbol disposableInterface = getDisposableInterface(hasAwait); 256NamedTypeSymbol alternateInterface = getDisposableInterface(!hasAwait); 269bool implementsInterface(bool fromExpression, NamedTypeSymbol targetInterface, BindingDiagnosticBag diagnostics) 298NamedTypeSymbol getDisposableInterface(bool isAsync)
Binder\WithClassTypeParametersBinder.cs (2)
20private readonly NamedTypeSymbol _namedType; 23internal WithClassTypeParametersBinder(NamedTypeSymbol container, Binder next)
Binder\WithPrimaryConstructorParametersBinder.cs (2)
17private readonly NamedTypeSymbol _type; 21internal WithPrimaryConstructorParametersBinder(NamedTypeSymbol type, Binder next)
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
112((NamedTypeSymbol)nsOrType.NamespaceOrType).GetExtensionMethods(methods, name, arity, options);
BoundTree\BoundExpressionExtensions.cs (3)
135public static NamedTypeSymbol? GetInferredDelegateType(this BoundExpression expr, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 139var delegateType = expr.GetFunctionType()?.GetInternalDelegateType(); 265return receiverType is NamedTypeSymbol { Kind: SymbolKind.NamedType, IsComImport: true };
BoundTree\BoundInlineArrayAccess.cs (3)
20NamedTypeSymbol 50NamedTypeSymbol 62Debug.Assert(((NamedTypeSymbol)Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Equals(Expression.Type?.TryGetInlineArrayElementField()?.TypeWithAnnotations ?? default, TypeCompareKind.ConsiderEverything));
BoundTree\NullabilityRewriter.cs (1)
156var updatedDelegateType = _snapshotManager?.GetUpdatedDelegateTypeForLambda(lambda);
BoundTree\UnboundLambda.cs (33)
146var delegateType = Type.GetDelegateType(); 164internal LambdaSymbol CreateLambdaSymbol(NamedTypeSymbol delegateType, Symbol containingSymbol) => 303NamedTypeSymbol? taskType = null; 304var delegateReturnType = delegateType?.GetDelegateType()?.DelegateInvokeMethod?.ReturnType as NamedTypeSymbol; 449public BoundLambda Bind(NamedTypeSymbol delegateType, bool isExpressionTree) 455public BoundLambda BindForReturnTypeInference(NamedTypeSymbol delegateType) 468public TypeWithAnnotations InferReturnType(ConversionsBase conversions, NamedTypeSymbol delegateType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 504Constraint = "Avoid " + nameof(ConcurrentDictionary<(NamedTypeSymbol, bool), BoundLambda>) + " which has a large default size, but this cache is normally small.")] 505private ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>? _bindingCache; 521_bindingCache = ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>.Empty.WithComparers(BindingCacheComparer.Instance); 597public BoundLambda Bind(NamedTypeSymbol delegateType, bool isTargetExpressionTree) 633private static MethodSymbol? DelegateInvokeMethod(NamedTypeSymbol? delegateType) 697internal NamedTypeSymbol? InferDelegateType() 774private BoundLambda ReallyBind(NamedTypeSymbol delegateType, bool inExpressionTree) 897internal LambdaSymbol CreateLambdaSymbol(NamedTypeSymbol delegateType, Symbol containingSymbol) 931NamedTypeSymbol? delegateType, 1006public BoundLambda BindForReturnTypeInference(NamedTypeSymbol delegateType) 1027public readonly NamedTypeSymbol? TaskLikeReturnTypeOpt; 1031private ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations> parameterTypes, ImmutableArray<RefKind> parameterRefKinds, NamedTypeSymbol? taskLikeReturnTypeOpt) 1078public static ReturnInferenceCacheKey Create(NamedTypeSymbol? delegateType, bool isAsync) 1080GetFields(delegateType, isAsync, out var parameterTypes, out var parameterRefKinds, out var taskLikeReturnTypeOpt); 1089NamedTypeSymbol? delegateType, 1093out NamedTypeSymbol? taskLikeReturnTypeOpt) 1121var delegateReturnType = invoke.ReturnType as NamedTypeSymbol; 1190var delegateType = (NamedTypeSymbol?)lambda.Type; 1197NamedTypeSymbol? delegateType, 1414private sealed class BindingCacheComparer : IEqualityComparer<(NamedTypeSymbol Type, bool IsExpressionTree)> 1418public bool Equals([AllowNull] (NamedTypeSymbol Type, bool IsExpressionTree) x, [AllowNull] (NamedTypeSymbol Type, bool IsExpressionTree) y) 1421public int GetHashCode([DisallowNull] (NamedTypeSymbol Type, bool IsExpressionTree) obj)
CodeGen\CodeGenerator_HasHome.cs (2)
75if (!IsAnyReadOnly(addressKind) && containingSymbol is MethodSymbol { ContainingSymbol: NamedTypeSymbol, IsEffectivelyReadOnly: true }) 245if (!TypeSymbol.Equals(field.ContainingType, containingSymbol.ContainingSymbol as NamedTypeSymbol, TypeCompareKind.AllIgnoreOptions))
CodeGen\EmitAddress.cs (1)
568var fixedImpl = field.FixedImplementationType(_module);
CodeGen\EmitArrayInitializer.cs (4)
398private bool TryEmitOptimizedReadonlySpanCreation(NamedTypeSymbol spanType, BoundExpression wrappedExpression, bool used, BoundExpression inPlaceTarget, out bool avoidInPlace, BoundExpression? start = null, BoundExpression? length = null) 632bool tryEmitAsCachedArrayFromBlob(NamedTypeSymbol spanType, BoundExpression wrappedExpression, int elementCount, ImmutableArray<byte> data, ref ArrayTypeSymbol arrayType, TypeSymbol elementType) 682bool tryEmitAsCachedArrayOfConstants(BoundArrayCreation arrayCreation, ArrayTypeSymbol arrayType, TypeSymbol elementType, NamedTypeSymbol spanType, bool used, BoundExpression? inPlaceTarget, out bool avoidInPlace) 756void emitEmptyReadonlySpan(NamedTypeSymbol spanType, BoundExpression wrappedExpression, bool used, BoundExpression? inPlaceTarget)
CodeGen\EmitConversion.cs (4)
71var typeTo = (NamedTypeSymbol)expression.Type; 293fromType = ((NamedTypeSymbol)fromType).EnumUnderlyingType; 302toType = ((NamedTypeSymbol)toType).EnumUnderlyingType;
CodeGen\EmitExpression.cs (11)
179var thisType = _method.ContainingType; 1020elementType = ((NamedTypeSymbol)elementType).EnumUnderlyingType; 1436type = ((NamedTypeSymbol)type).EnumUnderlyingType; 1852NamedTypeSymbol methodContainingType = method.ContainingType; 2182private bool IsReadOnlyCall(MethodSymbol method, NamedTypeSymbol methodContainingType) 2312var containingType = method.ContainingType; 2470TryEmitOptimizedReadonlySpanCreation((NamedTypeSymbol)expression.Type, expression.Arguments[0], used, inPlaceTarget, out avoidInPlace, 2488if (originalDef.ContainingType.Name == NamedTypeSymbol.ValueTupleTypeName && 3217elementType = ((NamedTypeSymbol)elementType).EnumUnderlyingType; 3315type = ((NamedTypeSymbol)type).EnumUnderlyingType; 3983(to.IsInterfaceType() && from.IsInterfaceType() && !from.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics.ContainsKey((NamedTypeSymbol)to));
CodeGen\EmitStackAllocInitializer.cs (3)
24Debug.Assert(type is PointerTypeSymbol || type is NamedTypeSymbol); 29: ((NamedTypeSymbol)type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]).Type; 74var readOnlySpan = spanGetItemDefinition.ContainingType.Construct(elementType);
CodeGen\EmitStatement.cs (5)
1393var int32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Int32, syntaxNode, _diagnostics); 1418var charType = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics); 1518var UInt32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_UInt32, syntaxNode, _diagnostics); 1633var spanCharLengthMethod = spanTLengthMethod.AsMember((NamedTypeSymbol)keyType); 1658var spanCharLengthMethod = spanTIndexerMethod.AsMember((NamedTypeSymbol)keyType);
Compilation\AttributeSemanticModel.cs (5)
23NamedTypeSymbol attributeType, 39public static AttributeSemanticModel Create(PublicSemanticModel containingSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Symbol? attributeTarget, Binder rootBinder, ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 48public static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, int position) 53private NamedTypeSymbol AttributeType 57return (NamedTypeSymbol)MemberSymbol;
Compilation\BuiltInOperators.cs (1)
693Debug.Assert(((NamedTypeSymbol)readonlySpanOfByte).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte);
Compilation\CSharpCompilation.cs (25)
59private NamedTypeSymbol? _lazyScriptClass = ErrorTypeSymbol.UnknownResultType; 150private ConcurrentCache<TypeSymbol, NamedTypeSymbol>? _lazyTypeToNullableVersion; 1534internal new NamedTypeSymbol? ScriptClass 1661internal NamedTypeSymbol GetSpecialType(ExtendedSpecialType specialType) 1668NamedTypeSymbol result; 1683private ConcurrentCache<TypeSymbol, NamedTypeSymbol> TypeToNullableVersion 1687return InterlockedOperations.Initialize(ref _lazyTypeToNullableVersion, static () => new ConcurrentCache<TypeSymbol, NamedTypeSymbol>(size: 100)); 1698internal NamedTypeSymbol GetOrCreateNullableType(TypeSymbol typeArgument) 1822internal new NamedTypeSymbol? GetTypeByMetadataName(string fullyQualifiedMetadataName) 1824var result = this.Assembly.GetTypeByMetadataName(fullyQualifiedMetadataName, includeReferences: true, isWellKnownType: false, conflicts: out var _); 1844internal new NamedTypeSymbol ObjectType 1927NamedTypeSymbol? mainType; 1931var scriptClass = this.ScriptClass; 1950mainType = mainTypeOrNamespace as NamedTypeSymbol; 2177if (!(method.ReturnType is NamedTypeSymbol namedType)) 2408AccessCheck.IsSymbolAccessible(symbol0, (NamedTypeSymbol)within0, ref discardedUseSiteInfo, throughType0); 3600case NamedTypeSymbol namedType: 3607public override void VisitNamedType(NamedTypeSymbol symbol) 4116var internalType = type.EnsureCSharpSymbolOrNull($"{nameof(callingConventionTypes)}[{index}]"); 4131internal new NamedTypeSymbol CreateNativeIntegerTypeSymbol(bool signed) 4151return NamedTypeSymbol.CreateTuple( 4168NamedTypeSymbol csharpUnderlyingTuple = underlyingType.EnsureCSharpSymbolOrNull(nameof(underlyingType)); 4179var tupleType = NamedTypeSymbol.CreateTuple( 4447=> IsReadOnlySpanType(type) && ((NamedTypeSymbol)type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].SpecialType == SpecialType.System_Byte;
Compilation\CSharpSemanticModel.cs (19)
413NamedTypeSymbol attributeType = (NamedTypeSymbol)binder.BindType(attribute.Name, BindingDiagnosticBag.Discarded, out aliasOpt).Type; 1595if ((object)containingType != null && containingType.Kind == SymbolKind.NamedType && ((NamedTypeSymbol)containingType).IsScriptClass) 2772var attributeType = (NamedTypeSymbol)binder.BindType(attribute.Name, BindingDiagnosticBag.Discarded, out aliasOpt).Type; 3590var namedType = (NamedTypeSymbol)attribute.Type; 3599if (candidateSymbols.Length == 1 && candidateSymbols[0] is NamedTypeSymbol) 3601namedType = (NamedTypeSymbol)candidateSymbols[0]; 3682NamedTypeSymbol containingType = binder.ContainingType; 3730private static ParameterSymbol GetThisParameter(TypeSymbol typeOfThis, NamedTypeSymbol containingType, Symbol containingMember, out LookupResultKind resultKind) 3864var objectType = binaryOperator.Type.ContainingAssembly.GetSpecialType(SpecialType.System_Object); 3969NamedTypeSymbol typeSymbol = null; 3990typeSymbol = (NamedTypeSymbol)unwrappedSymbols[0]; 4001typeSymbol = unwrappedSymbols[0] as NamedTypeSymbol; 4015NamedTypeSymbol typeSymbolOpt, 5158return (GetSymbolInfo(tupleTypeSyntax, cancellationToken).Symbol.GetSymbol() as NamedTypeSymbol)?.TupleElements.ElementAtOrDefault(tupleTypeSyntax.Elements.IndexOf(declarationSyntax)).GetPublicSymbol(); 5180typeDeclaration, namedType.GetSymbol<NamedTypeSymbol>()); 5236protected static SynthesizedPrimaryConstructor TryGetSynthesizedPrimaryConstructor(TypeDeclarationSyntax node, NamedTypeSymbol type)
Compilation\MemberSemanticModel.cs (6)
1087var anonymousType = bound.Type as NamedTypeSymbol; 1103return (bound == null) ? null : (bound.Type as NamedTypeSymbol).GetPublicSymbol(); 1124var tupleLiteralType = GetTypeOfTupleLiteral(tupleLiteral); 1140private NamedTypeSymbol GetTypeOfTupleLiteral(TupleExpressionSyntax declaratorSyntax) 1144return (bound as BoundTupleExpression)?.Type as NamedTypeSymbol;
Compilation\PublicSemanticModel.cs (2)
20var attributeType = (NamedTypeSymbol)enclosingBinder.BindType(attribute.Name, BindingDiagnosticBag.Discarded, out aliasOpt).Type;
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
45NamedTypeSymbol attributeType,
Compilation\SyntaxTreeSemanticModel.cs (7)
760internal PublicSemanticModel CreateSpeculativeAttributeSemanticModel(int position, AttributeSyntax attribute, Binder binder, AliasSymbol aliasOpt, NamedTypeSymbol attributeType) 1377private NamedTypeSymbol GetDeclaredType(BaseTypeDeclarationSyntax declarationSyntax) 1385private NamedTypeSymbol GetDeclaredType(DelegateDeclarationSyntax declarationSyntax) 1393private NamedTypeSymbol GetDeclaredNamedType(CSharpSyntaxNode declarationSyntax, string name) 1401return GetDeclaredMember(container, declarationSyntax.Span, isKnownToBeANamespace: false, name) as NamedTypeSymbol; 2088var delegateType = (GetDeclaredSymbol(memberDecl, cancellationToken) as INamedTypeSymbol).GetSymbol(); 2163case NamedTypeSymbol typeSymbol:
Compiler\ClsComplianceChecker.cs (32)
237public override void VisitNamedType(NamedTypeSymbol symbol) 273private bool HasAcceptableAttributeConstructor(NamedTypeSymbol attributeType) 450CheckMemberDistinctness((NamedTypeSymbol)symbol); 473NamedTypeSymbol type = (NamedTypeSymbol)symbol; 501NamedTypeSymbol containingType = symbol.ContainingType; 512private void CheckBaseTypeCompliance(NamedTypeSymbol symbol) 520foreach (NamedTypeSymbol interfaceType in symbol.InterfacesNoUseSiteDiagnostics()) 531NamedTypeSymbol baseType = symbol.EnumUnderlyingType ?? symbol.BaseTypeNoUseSiteDiagnostics; // null for interfaces 545NamedTypeSymbol containingType = symbol.ContainingType; 553private void CheckTypeParameterCompliance(ImmutableArray<TypeParameterSymbol> typeParameters, NamedTypeSymbol context) 572private void CheckParameterCompliance(ImmutableArray<ParameterSymbol> parameters, NamedTypeSymbol context) 747symbol = ((NamedTypeSymbol)symbol).DelegateInvokeMethod; 812NamedTypeSymbol type = (NamedTypeSymbol)symbol; 819foreach (NamedTypeSymbol @interface in type.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics.Keys) // NOTE: would be hand-rolled in a standalone component. 835NamedTypeSymbol baseType = type.BaseTypeNoUseSiteDiagnostics; 981private bool IsCompliantType(TypeSymbol type, NamedTypeSymbol context) 1006return IsCompliantType((NamedTypeSymbol)type, context); 1012private bool IsCompliantType(NamedTypeSymbol type, NamedTypeSymbol context) 1063private static bool IsInaccessibleBecauseOfConstruction(NamedTypeSymbol type, NamedTypeSymbol context) 1068Dictionary<NamedTypeSymbol, NamedTypeSymbol> containingTypes = null; // maps definition to constructed 1070NamedTypeSymbol containingType = type.ContainingType; 1075containingTypes = new Dictionary<NamedTypeSymbol, NamedTypeSymbol>(); 1094NamedTypeSymbol contextBaseType = context; 1097NamedTypeSymbol containingType; 1192NamedTypeSymbol attributeClass = data.AttributeClass; 1269return symbol.Kind == SymbolKind.NamedType && ((NamedTypeSymbol)symbol).IsImplicitClass;
Compiler\DocumentationCommentCompiler.cs (2)
218public override void VisitNamedType(NamedTypeSymbol symbol) 620MethodSymbol delegateInvoke = ((NamedTypeSymbol)symbol).DelegateInvokeMethod;
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
570NamedTypeSymbol typeSymbol = (NamedTypeSymbol)memberSymbol; 592NamedTypeSymbol typeSymbol = (NamedTypeSymbol)currentSymbol;
Compiler\MethodBodySynthesizer.cs (4)
38var objectType = constructor.ContainingAssembly.GetSpecialType(SpecialType.System_Object); 242NamedTypeSymbol fieldType = (NamedTypeSymbol)field.Type; 595NamedTypeSymbol baseType = method.ContainingType.BaseTypeNoUseSiteDiagnostics;
Compiler\MethodBodySynthesizer.Lowered.cs (5)
148NamedTypeSymbol spanChar = F.WellKnownType(_isReadOnlySpan 384NamedTypeSymbol equalityComparerType = system_Collections_Generic_EqualityComparer_T__GetHashCode.ContainingType; 385NamedTypeSymbol constructedEqualityComparer = equalityComparerType.Construct(valueToHash.Type); 418NamedTypeSymbol equalityComparerType = equalityComparer_Equals.ContainingType; 426var constructedEqualityComparer = equalityComparerType.Construct(field.Type);
Compiler\MethodCompiler.cs (6)
175methodCompiler.CompileSynthesizedMethods([(NamedTypeSymbol)hotReloadException], diagnostics); 410public override object VisitNamedType(NamedTypeSymbol symbol, TypeCompilationState arg) 433private Task CompileNamedTypeAsync(NamedTypeSymbol symbol) 448private void CompileNamedType(NamedTypeSymbol containingType) 682private void CompileSynthesizedMethods(ImmutableArray<NamedTypeSymbol> additionalTypes, BindingDiagnosticBag diagnostics) 686foreach (var additionalType in additionalTypes)
Compiler\ModuleCompilationState.cs (1)
11internal sealed class ModuleCompilationState : ModuleCompilationState<NamedTypeSymbol, MethodSymbol>
Compiler\SynthesizedMetadataCompiler.cs (1)
62public override void VisitNamedType(NamedTypeSymbol symbol)
Compiler\TypeCompilationState.cs (4)
57private readonly NamedTypeSymbol? _typeOpt; 82public TypeCompilationState(NamedTypeSymbol? typeOpt, CSharpCompilation compilation, PEModuleBuilder? moduleBuilderOpt) 92public NamedTypeSymbol Type 106public NamedTypeSymbol? DynamicOperationContextType
DocumentationComments\DocumentationCommentIDVisitor.cs (1)
69public override object VisitNamedType(NamedTypeSymbol symbol, StringBuilder builder)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (3)
160Debug.Assert(containingSymbol is NamedTypeSymbol); 164for (NamedTypeSymbol curr = containingSymbol.ContainingType; (object)curr != null; curr = curr.ContainingType) 176public override object VisitNamedType(NamedTypeSymbol symbol, StringBuilder builder)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (32)
276public override Symbol? VisitNamedType(NamedTypeSymbol sourceType) 278var originalDef = sourceType.OriginalDefinition; 284var otherDef = (NamedTypeSymbol?)Visit(originalDef); 335return (NamedTypeSymbol?)value.Type?.GetInternalSymbol(); 343return (NamedTypeSymbol?)value.Type?.GetInternalSymbol(); 348return (NamedTypeSymbol?)value.Delegate?.GetInternalSymbol(); 443SymbolKind.NamedType or SymbolKind.ErrorType => ((NamedTypeSymbol)otherContainer).TypeParameters, 458var type = (NamedTypeSymbol?)Visit(((CSharpCustomModifier)modifier).ModifierSymbol); 493var otherDelegateType = (NamedTypeSymbol?)otherTypeCandidate.Type.GetInternalSymbol(); 507bool isCorrespondingAnonymousDelegate(NamedTypeSymbol type, NamedTypeSymbol otherType) 534var otherType = (NamedTypeSymbol?)Visit(member.ContainingType); 621private bool AreNamedTypesEqual(NamedTypeSymbol type, NamedTypeSymbol other) 632private static NamedTypeSymbol SubstituteTypeParameters(NamedTypeSymbol type) 767return AreNamedTypesEqual((NamedTypeSymbol)type, (NamedTypeSymbol)other); 783var type = (NamedTypeSymbol)symbol; 840private readonly NamedTypeSymbol _systemObject; 842public DeepTranslator(NamedTypeSymbol systemObject) 877public override Symbol VisitNamedType(NamedTypeSymbol type) 879var originalDef = type.OriginalDefinition; 887var translatedOriginalDef = (NamedTypeSymbol)this.Visit(originalDef); 950var translatedType = (NamedTypeSymbol)this.Visit(((CSharpCustomModifier)modifier).ModifierSymbol);
Emitter\EditAndContinue\EmitHelpers.cs (1)
164var type = compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_HotReloadException);
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (6)
133var type = (NamedTypeSymbol)metadataDecoder.GetTypeOfToken(handle); 149var type = (NamedTypeSymbol)metadataDecoder.GetTypeOfToken(handle); 167var type = (NamedTypeSymbol)metadataDecoder.GetTypeOfToken(handle);
Emitter\Model\AttributeDataAdapter.cs (1)
180var type = this.AttributeClass;
Emitter\Model\GenericNamespaceTypeInstanceReference.cs (1)
19public GenericNamespaceTypeInstanceReference(NamedTypeSymbol underlyingNamedType)
Emitter\Model\GenericNestedTypeInstanceReference.cs (1)
18public GenericNestedTypeInstanceReference(NamedTypeSymbol underlyingNamedType)
Emitter\Model\GenericTypeInstanceReference.cs (1)
25public GenericTypeInstanceReference(NamedTypeSymbol underlyingNamedType)
Emitter\Model\MethodSymbolAdapter.cs (2)
84NamedTypeSymbol containingType = AdaptedMethodSymbol.ContainingType; 266NamedTypeSymbol container = AdaptedMethodSymbol.ContainingType;
Emitter\Model\NamedTypeReference.cs (2)
18protected readonly NamedTypeSymbol UnderlyingNamedType; 20public NamedTypeReference(NamedTypeSymbol underlyingNamedType)
Emitter\Model\NamedTypeSymbolAdapter.cs (15)
288NamedTypeSymbol baseType = AdaptedNamedTypeSymbol.BaseTypeNoUseSiteDiagnostics; 487foreach (NamedTypeSymbol @interface in AdaptedNamedTypeSymbol.GetInterfacesToEmit()) 655foreach (NamedTypeSymbol type in AdaptedNamedTypeSymbol.GetTypeMembers()) // Ordered. 956internal abstract ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit(); 958protected ImmutableArray<NamedTypeSymbol> CalculateInterfacesToEmit() 963ArrayBuilder<NamedTypeSymbol> builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 964HashSet<NamedTypeSymbol> seen = null; 975private static void InterfacesVisit(NamedTypeSymbol namedType, ArrayBuilder<NamedTypeSymbol> builder, ref HashSet<NamedTypeSymbol> seen) 980foreach (NamedTypeSymbol @interface in namedType.InterfacesNoUseSiteDiagnostics()) 985seen = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.CLRSignature); 1051internal NamedTypeSymbolAdapter(NamedTypeSymbol underlyingNamedTypeSymbol) 1063internal NamedTypeSymbol AdaptedNamedTypeSymbol { get; }
Emitter\Model\PEAssemblyBuilder.cs (9)
28private readonly ImmutableArray<NamedTypeSymbol> _additionalTypes; 73ImmutableArray<NamedTypeSymbol> additionalTypes) 88public sealed override ImmutableArray<NamedTypeSymbol> GetAdditionalTopLevelTypes() 91internal sealed override ImmutableArray<NamedTypeSymbol> GetEmbeddedTypes(BindingDiagnosticBag diagnostics) 93var builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 577var userDefinedAttribute = _sourceAssembly.SourceModule.LookupTopLevelMetadataType(ref attributeMetadataName); 608private NamedTypeSymbol GetWellKnownType(WellKnownType type, BindingDiagnosticBag diagnostics) 610var result = _sourceAssembly.DeclaringCompilation.GetWellKnownType(type); 615private NamedTypeSymbol GetSpecialType(SpecialType type, BindingDiagnosticBag diagnostics)
Emitter\Model\PEModuleBuilder.cs (50)
26internal abstract class PEModuleBuilder : PEModuleBuilder<CSharpCompilation, SourceModuleSymbol, AssemblySymbol, TypeSymbol, NamedTypeSymbol, MethodSymbol, SyntaxNode, NoPia.EmbeddedTypesManager, ModuleCompilationState> 48private Dictionary<FieldSymbol, NamedTypeSymbol> _fixedImplementationTypes; 211internal sealed override IEnumerable<Cci.INestedTypeDefinition> GetSynthesizedNestedTypes(NamedTypeSymbol container) 495internal virtual NamedTypeSymbol GetDynamicOperationContextType(NamedTypeSymbol contextType) 575yield return ((NamedTypeSymbol)member).GetCciAdapter(); 655internal static HashSet<NamedTypeSymbol> GetForwardedTypes(SourceAssemblySymbol sourceAssembly, ArrayBuilder<Cci.ExportedType>? builder) 657var seenTopLevelForwardedTypes = new HashSet<NamedTypeSymbol>(); 672var exportedNamesMap = new Dictionary<string, NamedTypeSymbol>(StringOrdinalComparer.Instance); 676var type = (NamedTypeSymbol)exportedType.Type.GetInternalSymbol(); 705NamedTypeSymbol contender; 737HashSet<NamedTypeSymbol> seenTopLevelTypes, 738CommonAssemblyWellKnownAttributeData<NamedTypeSymbol> wellKnownAttributeData, 744var stack = ArrayBuilder<(NamedTypeSymbol type, int parentIndex)>.GetInstance(); 747IEnumerable<NamedTypeSymbol> orderedForwardedTypes = wellKnownAttributeData.ForwardedTypes; 754foreach (NamedTypeSymbol forwardedType in orderedForwardedTypes) 756NamedTypeSymbol originalDefinition = forwardedType.OriginalDefinition; 789ImmutableArray<NamedTypeSymbol> nested = type.GetTypeMembers(); // Ordered. 814private NamedTypeSymbol GetUntranslatedSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 846var namedType = typeRef.GetInternalSymbol() as NamedTypeSymbol; 955NamedTypeSymbol namedTypeSymbol, 1016NamedTypeSymbol container = namedTypeSymbol.ContainingType; 1060else if (namedTypeSymbol.NativeIntegerUnderlyingType is NamedTypeSymbol underlyingType) 1077private void CheckTupleUnderlyingType(NamedTypeSymbol namedTypeSymbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 1083var declaredBase = namedTypeSymbol.BaseTypeNoUseSiteDiagnostics; 1112public static bool IsGenericType(NamedTypeSymbol toCheck) 1152return Translate((NamedTypeSymbol)typeSymbol, syntaxNodeOpt, diagnostics); 1250NamedTypeSymbol container = methodSymbol.ContainingType; 1324NamedTypeSymbol container = methodSymbol.ContainingType; 1463public NamedTypeSymbol SetFixedImplementationType(SourceMemberFieldSymbol field) 1467Interlocked.CompareExchange(ref _fixedImplementationTypes, new Dictionary<FieldSymbol, NamedTypeSymbol>(), null); 1472NamedTypeSymbol result; 1578NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte); 1599NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte); 1662NamedTypeSymbol booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean); 1904internal MethodSymbol EnsureInlineArrayAsSpanExists(SyntaxNode syntaxNode, NamedTypeSymbol spanType, NamedTypeSymbol intType, DiagnosticBag diagnostics) 1921internal NamedTypeSymbol EnsureInlineArrayTypeExists(SyntaxNode syntaxNode, SyntheticBoundNodeFactory factory, int arrayLength, DiagnosticBag diagnostics) 1941return (NamedTypeSymbol)typeAdapter.GetInternalSymbol()!; 1944internal NamedTypeSymbol EnsureReadOnlyListTypeExists(SyntaxNode syntaxNode, SynthesizedReadOnlyListKind kind, DiagnosticBag diagnostics) 1952NamedTypeSymbol typeSymbol; 1962typeSymbol = (NamedTypeSymbol)typeAdapter.GetInternalSymbol()!; 1973internal MethodSymbol EnsureInlineArrayAsReadOnlySpanExists(SyntaxNode syntaxNode, NamedTypeSymbol spanType, NamedTypeSymbol intType, DiagnosticBag diagnostics) 1990internal MethodSymbol EnsureInlineArrayElementRefExists(SyntaxNode syntaxNode, NamedTypeSymbol intType, DiagnosticBag diagnostics) 2006internal MethodSymbol EnsureInlineArrayElementRefReadOnlyExists(SyntaxNode syntaxNode, NamedTypeSymbol intType, DiagnosticBag diagnostics) 2068public sealed override ImmutableArray<NamedTypeSymbol> GetEmbeddedTypes(DiagnosticBag diagnostics) 2079internal virtual ImmutableArray<NamedTypeSymbol> GetEmbeddedTypes(BindingDiagnosticBag diagnostics)
Emitter\Model\SpecializedGenericNestedTypeInstanceReference.cs (1)
24public SpecializedGenericNestedTypeInstanceReference(NamedTypeSymbol underlyingNamedType)
Emitter\Model\SpecializedNestedTypeReference.cs (1)
21public SpecializedNestedTypeReference(NamedTypeSymbol underlyingNamedType)
Emitter\Model\SynthesizedPrivateImplementationDetailsStaticConstructor.cs (1)
18internal SynthesizedPrivateImplementationDetailsStaticConstructor(SynthesizedPrivateImplementationDetailsType privateImplementationType, NamedTypeSymbol voidType)
Emitter\Model\TypeParameterSymbolAdapter.cs (2)
231return ((NamedTypeSymbol)AdaptedTypeParameterSymbol.ContainingSymbol).GetCciAdapter(); 356return ((NamedTypeSymbol)AdaptedTypeParameterSymbol.ContainingSymbol).GetCciAdapter();
Emitter\NoPia\EmbeddedEvent.cs (5)
71NamedTypeSymbol underlyingContainingType = ContainingType.UnderlyingNamedType.AdaptedNamedTypeSymbol; 79NamedTypeSymbol sourceInterface = null; 89sourceInterface = attrData.CommonConstructorArguments[0].ValueInternal as NamedTypeSymbol; 95foreach (NamedTypeSymbol source in sourceInterface.AllInterfacesNoUseSiteDiagnostics) 128private bool EmbedMatchingInterfaceMethods(NamedTypeSymbol sourceInterface, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Emitter\NoPia\EmbeddedType.cs (3)
62foreach (NamedTypeSymbol @interface in UnderlyingNamedType.AdaptedNamedTypeSymbol.GetInterfacesToEmit()) 84NamedTypeSymbol baseType = UnderlyingNamedType.AdaptedNamedTypeSymbol.BaseTypeNoUseSiteDiagnostics; 130foreach (NamedTypeSymbol @interface in UnderlyingNamedType.AdaptedNamedTypeSymbol.GetInterfacesToEmit())
Emitter\NoPia\EmbeddedTypesManager.cs (6)
41private NamedTypeSymbol _lazySystemStringType = ErrorTypeSymbol.UnknownResultType; 55public NamedTypeSymbol GetSystemStringType(SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 252NamedTypeSymbol namedType, 349NamedTypeSymbol namedType, 366NamedTypeSymbol namedType, 615NamedTypeSymbol namedType = member.AdaptedSymbol.ContainingType;
FlowAnalysis\DefiniteAssignment.cs (3)
1262NamedTypeSymbol containingType = thisParameter.ContainingType; 2653var namedType = (NamedTypeSymbol)type;
FlowAnalysis\EmptyStructTypeCache.cs (18)
19private SmallDictionary<NamedTypeSymbol, bool> _cache; 28private SmallDictionary<NamedTypeSymbol, bool> Cache 32return _cache ?? (_cache = new SmallDictionary<NamedTypeSymbol, bool>(Symbols.SymbolEqualityComparer.ConsiderEverything)); 80return IsEmptyStructType(type, ConsList<NamedTypeSymbol>.Empty); 88private bool IsEmptyStructType(TypeSymbol type, ConsList<NamedTypeSymbol> typesWithMembersOfThisType) 90var nts = type as NamedTypeSymbol; 110private bool CheckStruct(ConsList<NamedTypeSymbol> typesWithMembersOfThisType, NamedTypeSymbol nts) 116typesWithMembersOfThisType = new ConsList<NamedTypeSymbol>(nts, typesWithMembersOfThisType); 126var nts = type.OriginalDefinition as NamedTypeSymbol; 134private bool CheckStructInstanceFields(ConsList<NamedTypeSymbol> typesWithMembersOfThisType, NamedTypeSymbol type) 164var nts = type as NamedTypeSymbol; 173public IEnumerable<FieldSymbol> GetStructFields(NamedTypeSymbol type, bool includeStatic) 191private FieldSymbol GetActualField(Symbol member, NamedTypeSymbol type)
FlowAnalysis\FlowAnalysisPass.cs (1)
114NamedTypeSymbol containingType = method.ContainingType;
FlowAnalysis\LocalDataFlowPass.cs (1)
174var restField = containingType.GetMembers(NamedTypeSymbol.ValueTupleRestFieldName).FirstOrDefault(s => s is not TupleVirtualElementFieldSymbol) as FieldSymbol;
FlowAnalysis\NullableWalker.cs (76)
906static ImmutableArray<Symbol> membersToBeInitialized(NamedTypeSymbol containingType, bool includeAllMembers, bool includeCurrentTypeRequiredMembers, bool includeBaseRequiredMembers) 1163var type = method.ContainingType; 1900if (node is BoundLambda boundLambda && originalSymbol is LambdaSymbol l && updatedSymbol is NamedTypeSymbol n) 3064type = ((NamedTypeSymbol)returnType.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 3645return type.IsErrorType() || type.IsDynamic() || type.HasUseSiteError || (type.IsAnonymousType && canIgnoreAnonymousType((NamedTypeSymbol)type)); 3647static bool canIgnoreAnonymousType(NamedTypeSymbol type) 3663(LambdaSymbol l, NamedTypeSymbol n) _ when n.IsDelegateType() => AreLambdaAndNewDelegateSimilar(l, n), 3671private static bool AreLambdaAndNewDelegateSimilar(LambdaSymbol l, NamedTypeSymbol n) 4037var containingType = constructor?.ContainingType; 4503var members = ((NamedTypeSymbol)type).GetMembersUnordered(); 4550var anonymousType = (NamedTypeSymbol)node.Type; 4638NamedTypeSymbol spanType => getSpanElementType(spanType), 4715NamedTypeSymbol spanType => setSpanElementType(spanType, inferredType), 4723static TypeWithAnnotations getSpanElementType(NamedTypeSymbol namedType) 4730static TypeSymbol setSpanElementType(NamedTypeSymbol namedType, TypeWithAnnotations elementType) 4889type = TypeWithAnnotations.Create(((NamedTypeSymbol)node.Type).OriginalDefinition.Construct(ImmutableArray.Create(type))); 5539var containingType = this._symbol?.ContainingType; 5560for (NamedTypeSymbol baseType = effectiveBase(type); !(baseType is null); baseType = baseType.BaseTypeNoUseSiteDiagnostics) 5565foreach (NamedTypeSymbol interfaceType in inheritedInterfaces(type)) 5571static NamedTypeSymbol effectiveBase(TypeSymbol type) => type switch 5577static ImmutableArray<NamedTypeSymbol> inheritedInterfaces(TypeSymbol type) => type switch 5581_ => ImmutableArray<NamedTypeSymbol>.Empty, 6425var wellKnownType = wellKnownMethod.ContainingType; 6427var constructedType = wellKnownType.Construct(ImmutableArray.Create(parameterType)); 7204var type = method.ContainingType; 8233var containingType = type as NamedTypeSymbol; 8253var symbolContainer = symbol.ContainingType; 8278foreach (var @interface in containingType.AllInterfacesNoUseSiteDiagnostics) 8304bool tryAsMemberOfSingleType(NamedTypeSymbol singleType, [NotNullWhen(true)] out Symbol? result) 8483var tupleOpt = (NamedTypeSymbol?)node.Type; 8522NamedTypeSymbol tupleType, 8530Debug.Assert(values.Length == (useRestField ? Math.Min(tupleType.TupleElements.Length, NamedTypeSymbol.ValueTupleRestPosition) : tupleType.TupleElements.Length)); 8538n = Math.Min(n, NamedTypeSymbol.ValueTupleRestPosition - 1); 8546values.Length == NamedTypeSymbol.ValueTupleRestPosition && 8547tupleType.GetMembers(NamedTypeSymbol.ValueTupleRestFieldName).FirstOrDefault() is FieldSymbol restField) 8549var argOrdinal = getArgumentOrdinalFromParameterOrdinal(NamedTypeSymbol.ValueTupleRestPosition - 1); 8597var valueTuple = operandType as NamedTypeSymbol; 8604var targetElements = ((NamedTypeSymbol)targetType).TupleElements; 8728private void ReportNullabilityMismatchWithTargetDelegate(Location location, NamedTypeSymbol delegateType, BoundLambda lambda) 8924NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { Parameters: { } parameters } signature } => (signature, parameters), 8933var delegateType = targetType.GetDelegateType(); 9660Action<NamedTypeSymbol>? analysisCompletion; 9662var delegateType = (NamedTypeSymbol)node.Type; 9690TypeWithState setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped) 9707void setAnalyzedNullabilityAsContinuation(BoundDelegateCreationExpression node, Action<NamedTypeSymbol>? analysisCompletion) 9713var delegateType = (NamedTypeSymbol)resultTypeWithAnnotations.Type; 9721Action<NamedTypeSymbol>? visitMethodGroupArgument(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, BoundMethodGroup group) 9729Action<NamedTypeSymbol>? analyzeMethodGroupConversion(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, BoundMethodGroup group, bool isTargetTyped) 9750Action<NamedTypeSymbol>? analyzeMethodGroupConversionAsContinuation(BoundDelegateCreationExpression node, BoundMethodGroup group) 9752return (NamedTypeSymbol delegateType) => 9758Action<NamedTypeSymbol>? visitLambdaArgument(NamedTypeSymbol delegateType, BoundLambda lambda, bool isTargetTyped) 9765Action<NamedTypeSymbol>? analyzeLambdaConversion(NamedTypeSymbol delegateType, BoundLambda lambda, bool isTargetTyped) 9782Action<NamedTypeSymbol> analyzeLambdaConversionAsContinuation(BoundLambda lambda) 9784return (NamedTypeSymbol delegateType) => analyzeLambdaConversion(delegateType, lambda, isTargetTyped: false); 9787Action<NamedTypeSymbol>? visitDelegateArgument(NamedTypeSymbol delegateType, BoundExpression arg, bool isTargetTyped) 9801Action<NamedTypeSymbol>? analyzeDelegateConversion(NamedTypeSymbol delegateType, BoundExpression arg, bool isTargetTyped) 9821Action<NamedTypeSymbol> analyzeDelegateConversionAsContinuation(BoundExpression arg) 9823return (NamedTypeSymbol delegateType) => analyzeDelegateConversion(delegateType, arg, isTargetTyped: false); 9924private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 10461if (expr.Type is NamedTypeSymbol { IsTupleType: true } tupleType) 10890valueProperty = getValue?.AsMember((NamedTypeSymbol)containingType)?.AssociatedSymbol; 11061NamedTypeSymbol spanType = compilation.GetWellKnownType(wellKnownSpan); 11503var reinferredGetResult = _visitResult.RValueType.Type is NamedTypeSymbol taskAwaiterType
FlowAnalysis\NullableWalker.SnapshotManager.cs (2)
72internal NamedTypeSymbol? GetUpdatedDelegateTypeForLambda(LambdaSymbol lambda) 76return (NamedTypeSymbol)updatedDelegate;
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (3)
34NamedTypeSymbol containingType, 111NamedTypeSymbol containingType, 186var exceptionType = _F.SpecialType(SpecialType.System_Object);
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (18)
34internal readonly NamedTypeSymbol BuilderType; 87NamedTypeSymbol builderType, 116var builderType = F.WellKnownType(WellKnownType.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder); 150var builderType = F.WellKnownType(WellKnownType.System_Runtime_CompilerServices_AsyncVoidMethodBuilder); 184var returnType = (NamedTypeSymbol)method.ReturnType; 185NamedTypeSymbol builderType; 255var returnType = (NamedTypeSymbol)method.ReturnType; 266NamedTypeSymbol builderType; 339private static NamedTypeSymbol ValidateBuilderType(SyntheticBoundNodeFactory F, TypeSymbol builderAttributeArgument, Accessibility desiredAccessibility, bool isGeneric, bool forMethodLevelBuilder = false) 341var builderType = builderAttributeArgument as NamedTypeSymbol; 374NamedTypeSymbol builderType, 423NamedTypeSymbol builderType, 471NamedTypeSymbol builderType) 500NamedTypeSymbol builderType, 501NamedTypeSymbol returnType)
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (24)
126NamedTypeSymbol boolType = F.SpecialType(SpecialType.System_Boolean); 200protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 262protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies) 297NamedTypeSymbol IAsyncEnumeratorOfElementType = 304var promiseType = (NamedTypeSymbol)_promiseOfValueOrEndField.Type; 312var moveNextAsyncReturnType = (NamedTypeSymbol)IAsyncEnumerableOfElementType_MoveNextAsync.ReturnType; 379.SymbolAsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 401.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 453.AsMember((NamedTypeSymbol)IAsyncDisposable_DisposeAsync.ReturnType); 477NamedTypeSymbol IAsyncEnumeratorOfElementType = 495NamedTypeSymbol IValueTaskSourceOfBool = 505.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 520NamedTypeSymbol IValueTaskSourceOfBool = 530.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 546NamedTypeSymbol IValueTaskSourceOfBool = 556.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 583.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 607.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 629.AsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 650NamedTypeSymbol IAsyncEnumerableOfElementType = 686setResultMethod = (MethodSymbol)setResultMethod.SymbolAsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type); 692setExceptionMethod = (MethodSymbol)setExceptionMethod.SymbolAsMember((NamedTypeSymbol)_promiseOfValueOrEndField.Type);
Lowering\AsyncRewriter\AsyncRewriter.cs (2)
202protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 214protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\AsyncRewriter\AsyncStateMachine.cs (3)
22private readonly ImmutableArray<NamedTypeSymbol> _interfaces; 30var interfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 78internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved)
Lowering\ClosureConversion\ClosureConversion.cs (20)
92private readonly Dictionary<NamedTypeSymbol, Symbol> _framePointers = new Dictionary<NamedTypeSymbol, Symbol>(); 158NamedTypeSymbol thisType, 228NamedTypeSymbol thisType, 323protected override NamedTypeSymbol ContainingType 414NamedTypeSymbol translatedLambdaContainer; 577private BoundExpression FrameOfType(SyntaxNode syntax, NamedTypeSymbol frameType) 592protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass) 663NamedTypeSymbol frameType = frame.ConstructIfGeneric(frameTypeParameters); 694BoundExpression right = FrameOfType(syntax, frameParent.Type as NamedTypeSymbol); 844FramePointer(node.Syntax, (NamedTypeSymbol)node.Type)); 897var frameType = (NamedTypeSymbol)loweredSymbol.Parameters[i].Type.OriginalDefinition; 932NamedTypeSymbol constructedFrame; 1017out NamedTypeSymbol constructedFrame) 1019var translatedLambdaContainer = synthesizedMethod.ContainingType; 1422NamedTypeSymbol translatedLambdaContainer; 1514out NamedTypeSymbol translatedLambdaContainer, 1634NamedTypeSymbol translatedLambdaContainer; 1650NamedTypeSymbol constructedFrame;
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (23)
24private NamedTypeSymbol _ExpressionType; 25private NamedTypeSymbol ExpressionType 37private NamedTypeSymbol _ParameterExpressionType; 38private NamedTypeSymbol ParameterExpressionType 50private NamedTypeSymbol _ElementInitType; 51private NamedTypeSymbol ElementInitType 63private NamedTypeSymbol _MemberBindingType; 65public NamedTypeSymbol MemberBindingType 77private readonly NamedTypeSymbol _int32Type; 79private readonly NamedTypeSymbol _objectType; 81private readonly NamedTypeSymbol _nullableType; 83private NamedTypeSymbol _MemberInfoType; 84private NamedTypeSymbol MemberInfoType 96private readonly NamedTypeSymbol _IEnumerableType; 600var e = type as NamedTypeSymbol; 732var nullable = (NamedTypeSymbol)node.Type; 798var d = node.Argument.Type as NamedTypeSymbol; 852var underlyingDelegateType = node.Type.GetDelegateType(); 1066var anonType = (NamedTypeSymbol)node.Type;
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (5)
20private readonly ImmutableArray<NamedTypeSymbol> _structEnvironments; 26NamedTypeSymbol containingType, 83var constructedStructClosures = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 86NamedTypeSymbol constructed; 103_structEnvironments = ImmutableArray<NamedTypeSymbol>.CastUp(structEnvironments);
Lowering\DiagnosticsPass_Warnings.cs (5)
114NamedTypeSymbol marshalByRefType = compilation.GetWellKnownType(WellKnownType.System_MarshalByRefObject); 153var interlocked = _compilation.GetWellKnownType(WellKnownType.System_Threading_Interlocked); 356NamedTypeSymbol nt = conv.Operand.Type as NamedTypeSymbol; 363for (var t = nt; (object)t != null; t = t.BaseTypeNoUseSiteDiagnostics)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
145var containingType = method.ContainingType;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (3)
175var contextType = factory.Compilation.GetWellKnownType(WellKnownType.Microsoft_CodeAnalysis_Runtime_LocalStoreTracker); 186private static bool IsSameOrNestedType(NamedTypeSymbol type, NamedTypeSymbol otherType)
Lowering\IteratorRewriter\IteratorRewriter.cs (4)
218var IEnumeratorOfElementType = F.SpecialType(SpecialType.System_Collections_Generic_IEnumerator_T).Construct(ImmutableArray.Create(_elementType)); 258var IEnumerableOfElementType = F.SpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).Construct(_elementType.Type); 301protected override void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal) 312protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\IteratorRewriter\IteratorStateMachine.cs (4)
22private readonly ImmutableArray<NamedTypeSymbol> _interfaces; 31var interfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 56internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 61internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(SpecialType.System_Object);
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
17private readonly NamedTypeSymbol? _constructedContainer;
Lowering\LocalRewriter\LocalRewriter.cs (3)
60NamedTypeSymbol? containingType, 88NamedTypeSymbol containingType, 330var delegateType = node.Type.GetDelegateType();
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (5)
1643NamedTypeSymbol nullableBoolType = _compilation.GetOrCreateNullableType(boolType); 1906var nullableType2 = nullableType as NamedTypeSymbol; 1913var nullableType2 = (NamedTypeSymbol)nullableType;
Lowering\LocalRewriter\LocalRewriter_Call.cs (4)
48NamedTypeSymbol firstContainer = node.ApplicableMethods.First().ContainingType; 1173Debug.Assert(parameters[i].Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true, IsValueType: true }); 1232var receiverNamedType = invokedAsExtensionMethod ? 1233((MethodSymbol)methodOrIndexer).Parameters[0].Type as NamedTypeSymbol :
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (25)
72var immutableArrayOfTargetCollectionTypeEmpty = immutableArrayOfTEmpty.AsMember((NamedTypeSymbol)node.Type); 204var iCollectionOfElementType = iCollectionOfTType.Construct(((NamedTypeSymbol)targetEnumerableType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics); 224Elements: [BoundCollectionExpressionSpreadElement { Expression: { Type: NamedTypeSymbol spreadType } expr }], 261var spanType = (NamedTypeSymbol)collectionType; 319var listToArray = ((MethodSymbol)_factory.WellKnownMember(WellKnownMember.System_Collections_Generic_List_T__ToArray)).AsMember((NamedTypeSymbol)list.Type); 399Debug.Assert(node.Type is NamedTypeSymbol); 404var collectionType = (NamedTypeSymbol)node.Type; 431var synthesizedType = _factory.ModuleBuilderOpt.EnsureReadOnlyListTypeExists(syntax, kind: kind, _diagnostics.DiagnosticBag).Construct(typeArgs); 480var spanType = (NamedTypeSymbol)constructMethod.Parameters[0].Type; 571var inlineArrayType = _factory.ModuleBuilderOpt.EnsureInlineArrayTypeExists(syntax, _factory, arrayLength, _diagnostics.DiagnosticBag).Construct(ImmutableArray.Create(elementType)); 574var intType = _factory.SpecialType(SpecialType.System_Int32); 671return _factory.Call(rewrittenSpreadExpression, listToArrayMethod.AsMember((NamedTypeSymbol)spreadExpression.Type!)); 695return _factory.Call(rewrittenSpreadExpression, toArrayMethod.AsMember((NamedTypeSymbol)rewrittenSpreadExpression.Type!)); 861var spanOfElementType = spanCtorArray.ContainingType.Construct(arrayType.ElementType); 869if (type is not NamedTypeSymbol namedType) 1009var spreadLength = _factory.Call(spreadOperandAsSpan, getLengthMethod.AsMember((NamedTypeSymbol)spreadOperandAsSpan.Type!)); 1010var targetSlice = _factory.Call(spanTemp, spanSliceMethod.AsMember((NamedTypeSymbol)spanTemp.Type!), indexTemp, spreadLength); 1011sideEffects.Add(_factory.Call(spreadOperandAsSpan, copyToMethod.AsMember((NamedTypeSymbol)spreadOperandAsSpan.Type!), targetSlice)); 1026var collectionType = _factory.WellKnownType(WellKnownType.System_Collections_Generic_List_T).Construct(typeArguments); 1108var spanGetItem = ((MethodSymbol)_factory.WellKnownMember(WellKnownMember.System_Span_T__get_Item)).AsMember((NamedTypeSymbol)spanTemp.Type); 1125Debug.Assert(spanTemp.Type is NamedTypeSymbol); 1129var elementType = ((NamedTypeSymbol)spanTemp.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
486var memberContainingType = fieldOrEvent.ContainingType; 765private BoundExpression BoxReceiver(BoundExpression rewrittenReceiver, NamedTypeSymbol memberContainingType)
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.cs (1)
136loweredAccessExpression = _factory.New((NamedTypeSymbol)nodeType, loweredAccessExpression);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (20)
25Debug.Assert(node.Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true }); 96var byteType = ((NamedTypeSymbol)node.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type; 115result = new BoundObjectCreationExpression(node.Syntax, ctor.AsMember((NamedTypeSymbol)node.Type), utf8Bytes, _factory.Literal(0), _factory.Literal(length)); 500var underlyingTypeFrom = rewrittenOperand.Type.GetEnumUnderlyingType()!; 511var underlyingTypeTo = rewrittenType.GetEnumUnderlyingType()!; 548rewrittenType: (NamedTypeSymbol)rewrittenType); 598NamedTypeSymbol spanType = (NamedTypeSymbol)rewrittenType; 621var destinationType = (NamedTypeSymbol)rewrittenType; 656MethodSymbol implicitOperator = implicitOperatorDefinition.AsMember((NamedTypeSymbol)sourceType); 668TypeWithAnnotations sourceElementType = ((NamedTypeSymbol)sourceType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 689TypeWithAnnotations sourceElementType = ((NamedTypeSymbol)sourceType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 903userDefinedConversionRewrittenType = ((NamedTypeSymbol)rewrittenOperand.Type.OriginalDefinition).Construct(userDefinedConversionRewrittenType); 952NamedTypeSymbol rewrittenType) 958var tupleTypeSymbol = (NamedTypeSymbol)rewrittenOperand.Type; 1118rewrittenOperandType = rewrittenOperandType.IsNullableType() ? ((NamedTypeSymbol)rewrittenOperandType.OriginalDefinition).Construct(typeFromUnderlying) : typeFromUnderlying; 1820var underlying = toType.GetEnumUnderlyingType(); 1833var underlying = fromType.GetEnumUnderlyingType();
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (2)
264var tupleType = NamedTypeSymbol.CreateTuple(locationOpt: null, elementTypesWithAnnotations: builder!.SelectAsArray(e => TypeWithAnnotations.Create(e.Type)),
Lowering\LocalRewriter\LocalRewriter_Event.cs (7)
26var @interface = node.Event.ContainingType; 97NamedTypeSymbol tokenType = _factory.WellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_EventRegistrationToken); 98NamedTypeSymbol marshalType = _factory.WellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_WindowsRuntimeMarshal); 100NamedTypeSymbol actionType = _factory.WellKnownType(WellKnownType.System_Action_T).Construct(tokenType); 141NamedTypeSymbol func2Type = _factory.WellKnownType(WellKnownType.System_Func_T2).Construct(eventType, tokenType); 237NamedTypeSymbol fieldType = (NamedTypeSymbol)fieldSymbol.Type;
Lowering\LocalRewriter\LocalRewriter_Field.cs (8)
55var tupleType = tupleField.ContainingType; 57NamedTypeSymbol currentLinkType = tupleType; 74WellKnownMember wellKnownTupleRest = NamedTypeSymbol.GetTupleTypeMember(NamedTypeSymbol.ValueTupleRestPosition, NamedTypeSymbol.ValueTupleRestPosition); 75var tupleRestField = (FieldSymbol?)NamedTypeSymbol.GetWellKnownMemberInType(currentLinkType.OriginalDefinition, wellKnownTupleRest, _diagnostics, syntax); 89currentLinkType = (NamedTypeSymbol)currentLinkType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestPosition - 1].Type;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (9)
82var spanType = (NamedTypeSymbol)nodeExpressionType; 88var spanType = (NamedTypeSymbol)nodeExpressionType; 322NamedTypeSymbol? idisposableTypeSymbol = null; 402var objectType = _factory.SpecialType(SpecialType.System_Object); 609NamedTypeSymbol? collectionType = (NamedTypeSymbol?)collectionExpression.Type; 773NamedTypeSymbol intType = rewriter._factory.SpecialType(SpecialType.System_Int32);
Lowering\LocalRewriter\LocalRewriter_Index.cs (1)
17NamedTypeSymbol booleanType = _compilation.GetSpecialType(SpecialType.System_Boolean);
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (8)
243MethodSymbol createSpan = getCreateSpanHelper(node, spanType: getItemOrSliceHelper.ContainingType, intType: (NamedTypeSymbol)getItemOrSliceHelper.Parameters[0].Type); 244getItemOrSliceHelper = getItemOrSliceHelper.AsMember((NamedTypeSymbol)createSpan.ReturnType); 321MethodSymbol getCreateSpanHelper(BoundInlineArrayAccess node, NamedTypeSymbol spanType, NamedTypeSymbol intType) 343var intType = (NamedTypeSymbol)index.Type; 391NamedTypeSymbol spanType = getItemOrSliceHelper.ContainingType; 393getItemOrSliceHelper = getItemOrSliceHelper.AsMember((NamedTypeSymbol)createSpan.ReturnType);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
81Debug.Assert(TypeSymbol.Equals(rewrittenObjectCreation.Type, ((NamedTypeSymbol)node.Type).ComImportCoClass, TypeCompareKind.ConsiderEverything2)); 114Debug.Assert(TypeSymbol.Equals(rewrittenObjectCreation.Type, ((NamedTypeSymbol)node.Type).ComImportCoClass, TypeCompareKind.ConsiderEverything2));
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (2)
52var spanType = (NamedTypeSymbol)type;
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (7)
428NamedTypeSymbol? charType = null; 434if (arg is BoundCall { ReceiverOpt: { Type: NamedTypeSymbol { SpecialType: SpecialType.System_Char } receiverCharType } receiver } potentialToStringCall && 498NamedTypeSymbol charType, 508var readOnlySpanOfChar = readOnlySpanCtorRefParamGeneric.ContainingType.Construct(charType); 626if (expr is BoundCall { Type.SpecialType: SpecialType.System_String, Method: { Name: "ToString" } method, ReceiverOpt: { Type: NamedTypeSymbol { SpecialType: SpecialType.System_Char } charType, ConstantValueOpt.IsChar: true } } call && 665var type = (NamedTypeSymbol)expr.Type;
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
126var objectType = _factory.SpecialType(SpecialType.System_Object);
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (15)
40return MakeTupleCreationExpression(node.Syntax, (NamedTypeSymbol)node.Type, rewrittenArguments); 43private BoundExpression MakeTupleCreationExpression(SyntaxNode syntax, NamedTypeSymbol type, ImmutableArray<BoundExpression> rewrittenArguments) 47ArrayBuilder<NamedTypeSymbol> underlyingTupleTypeChain = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 48NamedTypeSymbol.GetUnderlyingTypeChain(type, underlyingTupleTypeChain); 53NamedTypeSymbol smallestType = underlyingTupleTypeChain.Pop(); 55underlyingTupleTypeChain.Count * (NamedTypeSymbol.ValueTupleRestPosition - 1), 57var smallestCtor = (MethodSymbol?)NamedTypeSymbol.GetWellKnownMemberInType(smallestType.OriginalDefinition, 58NamedTypeSymbol.GetTupleCtor(smallestType.Arity), 73NamedTypeSymbol tuple8Type = underlyingTupleTypeChain.Peek(); 74var tuple8Ctor = (MethodSymbol?)NamedTypeSymbol.GetWellKnownMemberInType(tuple8Type.OriginalDefinition, 75NamedTypeSymbol.GetTupleCtor(NamedTypeSymbol.ValueTupleRestPosition), 89(underlyingTupleTypeChain.Count - 1) * (NamedTypeSymbol.ValueTupleRestPosition - 1), 90NamedTypeSymbol.ValueTupleRestPosition - 1)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
132var underlyingType = loweredOperand.Type.GetEnumUnderlyingType(); 963NamedTypeSymbol type = _compilation.GetSpecialType(specialType);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (14)
19private NamedTypeSymbol? _currentDynamicCallSiteContainer; 503var resultType = _factory.SpecialType(SpecialType.System_Boolean); 610NamedTypeSymbol? delegateTypeOverMethodTypeParameters = GetDelegateType(loweredReceiver, receiverRefKind, loweredArguments, refKinds, loweredRight, resultType); 611NamedTypeSymbol callSiteTypeGeneric = _factory.WellKnownType(WellKnownType.System_Runtime_CompilerServices_CallSite_T); 642var callSiteType = callSiteTypeGeneric.Construct(new[] { delegateTypeOverMethodTypeParameters }); 684private static NamedTypeSymbol CreateCallSiteContainer(SyntheticBoundNodeFactory factory, int methodOrdinal, int localFunctionOrdinal) 705internal FieldSymbol DefineCallSiteStorageSymbol(NamedTypeSymbol containerDefinition, NamedTypeSymbol delegateTypeOverMethodTypeParameters, TypeMap methodToContainerTypeParametersMap) 708var delegateTypeOverContainerTypeParameters = methodToContainerTypeParametersMap.SubstituteNamedType(delegateTypeOverMethodTypeParameters); 709var callSiteType = _factory.Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_CallSite_T); 718internal NamedTypeSymbol? GetDelegateType( 728var callSiteType = _factory.WellKnownType(WellKnownType.System_Runtime_CompilerServices_CallSite); 746var delegateType = _factory.Compilation.GetWellKnownType(wkDelegateType); 898var systemObjectType = _factory.SpecialType(SpecialType.System_Object);
Lowering\MethodToClassRewriter.cs (13)
41protected abstract BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass); 46protected abstract NamedTypeSymbol ContainingType { get; } 355var containingType = this.ContainingType; 548.AsMember((NamedTypeSymbol)this.VisitType(node.Field.ContainingType)); 557.AsMember((NamedTypeSymbol)this.VisitType(node.FieldSymbol.ContainingType)); 626var newType = (NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly(); 648.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(method.ContainingType).AsTypeSymbolOnly()) 665.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly()); 669var newType = (NamedTypeSymbol)TypeMap.SubstituteType(property.ContainingType).AsTypeSymbolOnly(); 692.AsMember((NamedTypeSymbol)TypeMap.SubstituteType(field.ContainingType).AsTypeSymbolOnly()); 737internal BaseMethodWrapperSymbol(NamedTypeSymbol containingType, MethodSymbol methodBeingWrapped, SyntaxNode syntax, string name)
Lowering\StateMachineRewriter\CapturedSymbol.cs (6)
26public abstract BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg); 39public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg) 42var field = this.HoistedField.AsMember((NamedTypeSymbol)frame.Type); 57public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg) 60var field = this.HoistedField.AsMember((NamedTypeSymbol)frame.Type); 77public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
191protected override NamedTypeSymbol ContainingType 204protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass)
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (4)
30public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, bool isPublic, bool isThis) 36public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeSymbol type, string name, SynthesizedLocalKind synthesizedKind, int slotIndex, bool isPublic) 41public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeSymbol type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic) : 46public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (4)
81protected abstract void InitializeStateMachine(ArrayBuilder<BoundStatement> bodyBuilder, NamedTypeSymbol frameType, LocalSymbol stateMachineLocal); 86protected abstract BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies); 239var containingType = method.ContainingType; 292var frameType = method.IsGenericMethod ? stateMachineType.Construct(method.TypeArgumentsWithAnnotations, unbound: false) : stateMachineType;
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (1)
62var kickoffType = KickoffMethod.ContainingType;
Lowering\SynthesizedMethodBaseSymbol.cs (1)
32protected SynthesizedMethodBaseSymbol(NamedTypeSymbol containingType,
Lowering\SynthesizedSubmissionFields.cs (3)
25private readonly NamedTypeSymbol _declaringSubmissionClass; 31public SynthesizedSubmissionFields(CSharpCompilation compilation, NamedTypeSymbol submissionClass) 94internal void AddToType(NamedTypeSymbol containingType, PEModuleBuilder moduleBeingBuilt)
Lowering\SyntheticBoundNodeFactory.cs (19)
52private NamedTypeSymbol? _currentType; 53public NamedTypeSymbol? CurrentType 114public SyntheticBoundNodeFactory(MethodSymbol? topLevelMethodOpt, NamedTypeSymbol? currentClassOpt, SyntaxNode node, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, InstrumentationState? instrumentationState = null) 147public void AddNestedType(NamedTypeSymbol nestedType) 154public void OpenNestedType(NamedTypeSymbol nestedType) 202public void AddField(NamedTypeSymbol containingType, FieldSymbol field) 225public BoundBaseReference Base(NamedTypeSymbol baseType) 288public NamedTypeSymbol SpecialType(SpecialType st) 290NamedTypeSymbol specialType = Compilation.GetSpecialType(st); 300public NamedTypeSymbol WellKnownType(WellKnownType wt) 302NamedTypeSymbol wellKnownType = Compilation.GetWellKnownType(wt); 674var objectType = SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Object); 731public BoundObjectCreationExpression New(NamedTypeSymbol type, params BoundExpression[] args) 740public BoundObjectCreationExpression New(NamedTypeSymbol type, ImmutableArray<BoundExpression> args) 1187NamedTypeSymbol baseType = CurrentFunction.ThisParameter.Type.BaseTypeNoUseSiteDiagnostics; 1297NamedTypeSymbol constructorInfo = WellKnownType(Microsoft.CodeAnalysis.WellKnownType.System_Reflection_ConstructorInfo); 1430private MethodSymbol GetMethodFromHandleMethod(NamedTypeSymbol methodContainer, TypeSymbol systemReflectionMethodOrConstructorInfo) 1454private MethodSymbol GetFieldFromHandleMethod(NamedTypeSymbol fieldContainer) 1513return this.Call(arg, this.SpecialMethod(CodeAnalysis.SpecialMember.System_Nullable_T_get_Value).AsMember((NamedTypeSymbol)arg.Type));
Operations\CSharpOperationFactory_Methods.cs (1)
435PropertySymbol property = AnonymousTypeManager.GetAnonymousTypeProperty(type.GetSymbol<NamedTypeSymbol>(), i);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (7)
179&& symbol is Symbols.PublicModel.Symbol { UnderlyingSymbol: NamedTypeSymbol { } internalSymbol1 } 189&& symbol is Symbols.PublicModel.Symbol { UnderlyingSymbol: NamedTypeSymbol { AssociatedFileIdentifier: { } identifier } internalSymbol2 }) 339NamedTypeSymbol? underlyingTypeSymbol = (symbol as Symbols.PublicModel.NamedTypeSymbol)?.UnderlyingNamedTypeSymbol; 433private ImmutableArray<ImmutableArray<CustomModifier>> GetTypeArgumentsModifiers(NamedTypeSymbol? underlyingTypeSymbol) 497while (currentUnderlying.Arity == NamedTypeSymbol.ValueTupleRestPosition) 499tupleSymbol = (INamedTypeSymbol)currentUnderlying.TypeArguments[NamedTypeSymbol.ValueTupleRestPosition - 1]; 516NamedTypeSymbol? underlyingTypeSymbol = (symbol as Symbols.PublicModel.NamedTypeSymbol)?.UnderlyingNamedTypeSymbol;
Symbols\AbstractTypeMap.cs (21)
25internal virtual NamedTypeSymbol SubstituteTypeDeclaration(NamedTypeSymbol previous) 29NamedTypeSymbol newContainingType = SubstituteNamedType(previous.ContainingType); 41internal NamedTypeSymbol SubstituteNamedType(NamedTypeSymbol previous) 57NamedTypeSymbol oldConstructedFrom = previous.ConstructedFrom; 58NamedTypeSymbol newConstructedFrom = SubstituteTypeDeclaration(oldConstructedFrom); 102result = SubstituteNamedType((NamedTypeSymbol)previous); 142NamedTypeSymbol modifier = ((CSharpCustomModifier)customModifiers[i]).ModifierSymbol; 143var substituted = SubstituteNamedType(modifier); 195ImmutableArray<NamedTypeSymbol> interfaces = t.InterfacesNoUseSiteDiagnostics(); 200Debug.Assert(interfaces[0] is NamedTypeSymbol); // IList<T> 201interfaces = ImmutableArray.Create<NamedTypeSymbol>(SubstituteNamedType(interfaces[0])); 205Debug.Assert(interfaces[0] is NamedTypeSymbol); // IList<T> 206interfaces = ImmutableArray.Create<NamedTypeSymbol>(SubstituteNamedType(interfaces[0]), SubstituteNamedType(interfaces[1])); 408internal ImmutableArray<NamedTypeSymbol> SubstituteNamedTypes(ImmutableArray<NamedTypeSymbol> original) 410NamedTypeSymbol[] result = null; 414var t = original[i]; 415var substituted = SubstituteNamedType(t); 420result = new NamedTypeSymbol[original.Length];
Symbols\AnonymousTypes\AnonymousTypeManager.cs (6)
31public NamedTypeSymbol ConstructAnonymousTypeSymbol(AnonymousTypeDescriptor typeDescr) 36public NamedTypeSymbol ConstructAnonymousDelegateSymbol(AnonymousTypeDescriptor typeDescr) 44internal static PropertySymbol GetAnonymousTypeProperty(NamedTypeSymbol type, int index) 56internal static ImmutableArray<TypeWithAnnotations> GetAnonymousTypeFieldTypes(NamedTypeSymbol type) 68public static NamedTypeSymbol ConstructAnonymousTypeSymbol(NamedTypeSymbol type, ImmutableArray<TypeWithAnnotations> newFieldTypes)
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (8)
109public NamedTypeSymbol System_Object 114public NamedTypeSymbol System_Void 119public NamedTypeSymbol System_Boolean 124public NamedTypeSymbol System_String 129public NamedTypeSymbol System_Int32 134public NamedTypeSymbol System_IntPtr 139public NamedTypeSymbol System_MulticastDelegate 144public NamedTypeSymbol System_Diagnostics_DebuggerBrowsableState
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (10)
185private NamedTypeSymbol ConstructAnonymousDelegateImplementationSymbol(AnonymousDelegatePublicSymbol anonymous, int generation) 426private NamedTypeSymbol ConstructAnonymousTypeImplementationSymbol(AnonymousTypePublicSymbol anonymous) 720internal ImmutableArray<NamedTypeSymbol> GetAllCreatedTemplates() 724var builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 747internal static bool IsAnonymousTypeTemplate(NamedTypeSymbol type) 756internal static ImmutableArray<MethodSymbol> GetAnonymousTypeHiddenMethods(NamedTypeSymbol type) 765internal static NamedTypeSymbol TranslateAnonymousTypeSymbol(NamedTypeSymbol type) 780NamedTypeSymbol translatedType = TranslateAnonymousTypeSymbol(method.ContainingType); 782foreach (var member in ((NamedTypeSymbol)translatedType.OriginalDefinition).GetMembers(method.Name))
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (18)
31internal abstract NamedTypeSymbol MapToImplementationSymbol(); 35protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 132public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 134return ImmutableArray<NamedTypeSymbol>.Empty; 137public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 139return ImmutableArray<NamedTypeSymbol>.Empty; 142public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 144return ImmutableArray<NamedTypeSymbol>.Empty; 152internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 154return ImmutableArray<NamedTypeSymbol>.Empty; 157internal sealed override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() 162internal abstract override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics { get; } 191public sealed override NamedTypeSymbol ConstructedFrom 256internal sealed override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 261internal sealed override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 263return ImmutableArray<NamedTypeSymbol>.Empty; 266internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 268internal sealed override NamedTypeSymbol? NativeIntegerUnderlyingType => null;
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.DelegatePublicSymbol.cs (2)
24internal override NamedTypeSymbol MapToImplementationSymbol() 39internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => Manager.System_MulticastDelegate;
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.TypePublicSymbol.cs (2)
64internal override NamedTypeSymbol MapToImplementationSymbol() 83internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => Manager.System_Object;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (1)
22internal AnonymousTypeConstructorSymbol(NamedTypeSymbol container, ImmutableArray<AnonymousTypePropertySymbol> properties)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (5)
238internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => ImmutableArray<NamedTypeSymbol>.Empty; 240internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty; 242internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => Manager.System_MulticastDelegate;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.EqualsMethodSymbol.cs (1)
21internal AnonymousTypeEqualsMethodSymbol(NamedTypeSymbol container)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
110public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.GetHashCodeMethodSymbol.cs (1)
27internal AnonymousTypeGetHashCodeMethodSymbol(NamedTypeSymbol container)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (3)
21private readonly NamedTypeSymbol _containingType; 40NamedTypeSymbol container, 171public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (3)
22private readonly NamedTypeSymbol _containingType; 25public SynthesizedMethodBase(NamedTypeSymbol containingType, string name) 46public override NamedTypeSymbol ContainingType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (5)
138internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 140return ImmutableArray<NamedTypeSymbol>.Empty; 143internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() 145return ImmutableArray<NamedTypeSymbol>.Empty; 148internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => this.Manager.System_Object;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ToStringMethodSymbol.cs (1)
27internal AnonymousTypeToStringMethodSymbol(NamedTypeSymbol container)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (14)
54protected sealed override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 185public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 187return ImmutableArray<NamedTypeSymbol>.Empty; 190public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 192return ImmutableArray<NamedTypeSymbol>.Empty; 195public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 197return ImmutableArray<NamedTypeSymbol>.Empty; 225public sealed override NamedTypeSymbol ConstructedFrom 230internal abstract override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics { get; } 232internal sealed override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 237internal sealed override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 239return ImmutableArray<NamedTypeSymbol>.Empty; 315internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 317internal sealed override NamedTypeSymbol? NativeIntegerUnderlyingType => null;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (3)
132internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 134return ImmutableArray<NamedTypeSymbol>.Empty; 137internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\ArrayTypeSymbol.cs (26)
23private readonly NamedTypeSymbol _baseType; 27NamedTypeSymbol array) 54NamedTypeSymbol array) 77NamedTypeSymbol array) 84NamedTypeSymbol array, 85ImmutableArray<NamedTypeSymbol> constructedInterfaces) 104private static ImmutableArray<NamedTypeSymbol> GetSZArrayInterfaces( 108var constructedInterfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 112var iListOfT = declaringAssembly.GetSpecialType(SpecialType.System_Collections_Generic_IList_T); 118var iReadOnlyListOfT = declaringAssembly.GetSpecialType(SpecialType.System_Collections_Generic_IReadOnlyList_T); 220internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => _baseType; 271public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 273return ImmutableArray<NamedTypeSymbol>.Empty; 276public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 278return ImmutableArray<NamedTypeSymbol>.Empty; 281public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 283return ImmutableArray<NamedTypeSymbol>.Empty; 509private readonly ImmutableArray<NamedTypeSymbol> _interfaces; 513NamedTypeSymbol array, 514ImmutableArray<NamedTypeSymbol> constructedInterfaces) 548internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) 572NamedTypeSymbol array) 595internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) 597return ImmutableArray<NamedTypeSymbol>.Empty; 606NamedTypeSymbol array) 635NamedTypeSymbol array)
Symbols\AssemblySymbol.cs (30)
322internal abstract NamedTypeSymbol? LookupDeclaredTopLevelMetadataType(ref MetadataTypeName emittedName); 334internal abstract NamedTypeSymbol LookupDeclaredOrForwardedTopLevelMetadataType(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies); 341public NamedTypeSymbol? ResolveForwardedType(string fullyQualifiedMetadataName) 355internal virtual NamedTypeSymbol? TryLookupForwardedMetadataTypeWithCycleDetection(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies) 372internal abstract IEnumerable<NamedTypeSymbol> GetAllTopLevelForwardedTypes(); 380internal abstract NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type); 386internal virtual void RegisterDeclaredSpecialType(NamedTypeSymbol corType) 406internal virtual NamedTypeSymbol GetNativeIntegerType(NamedTypeSymbol underlyingType) 604internal NamedTypeSymbol GetSpecialType(ExtendedSpecialType type) 621internal NamedTypeSymbol ObjectType 634internal NamedTypeSymbol GetPrimitiveType(Microsoft.Cci.PrimitiveTypeCode type) 645public NamedTypeSymbol? GetTypeByMetadataName(string fullyQualifiedMetadataName) 652var result = this.GetTypeByMetadataName(fullyQualifiedMetadataName, includeReferences: false, isWellKnownType: false, conflicts: out var _); 683internal NamedTypeSymbol? GetTypeByMetadataName( 692NamedTypeSymbol? type; 803var symbol = (NamedTypeSymbol?)GetTypeByReflectionType(nestedTypes[i].AsType()); 842NamedTypeSymbol? symbol = GetTopLevelTypeByMetadataName(ref mdName, assemblyId, includeReferences: true, isWellKnownType: false, conflicts: out var _); 859private NamedTypeSymbol? ApplyGenericArguments(NamedTypeSymbol symbol, Type[] typeArguments, ref int currentTypeArgument) 886internal NamedTypeSymbol? GetTopLevelTypeByMetadataName( 905NamedTypeSymbol? result; 930NamedTypeSymbol? corLibCandidate = GetTopLevelTypeByMetadataName(CorLibrary, ref metadataName, assemblyOpt); 965NamedTypeSymbol? candidate = GetTopLevelTypeByMetadataName(assembly, ref metadataName, assemblyOpt); 1014bool isValidCandidate([NotNullWhen(true)] NamedTypeSymbol? candidate, bool isWellKnownType) 1022private bool IsInCorLib(NamedTypeSymbol type) 1027private bool IsValidWellKnownType(NamedTypeSymbol? result) 1040private static NamedTypeSymbol? GetTopLevelTypeByMetadataName(AssemblySymbol assembly, ref MetadataTypeName metadataName, AssemblyIdentity? assemblyOpt) 1047var result = assembly.LookupDeclaredTopLevelMetadataType(ref metadataName);
Symbols\Attributes\AttributeData.cs (5)
32public new abstract NamedTypeSymbol? AttributeClass { get; } 88internal static bool IsTargetEarlyAttribute(NamedTypeSymbol attributeType, AttributeSyntax attributeSyntax, AttributeDescription description) 116var wellKnownType = compilation.GetWellKnownType(WellKnownType.System_Security_Permissions_SecurityAttribute); 519NamedTypeSymbol attrType = this.AttributeClass; 555private static bool PermissionSetAttributeTypeHasRequiredProperty(NamedTypeSymbol permissionSetType, string propName)
Symbols\Attributes\PEAttributeData.cs (3)
22private NamedTypeSymbol? _lazyAttributeClass = ErrorTypeSymbol.UnknownResultType; // Indicates uninitialized. 34public override NamedTypeSymbol? AttributeClass 94Interlocked.CompareExchange(ref _lazyAttributeClass, (NamedTypeSymbol?)attributeClass, ErrorTypeSymbol.UnknownResultType); // Serves as a flag, so do it last.
Symbols\Attributes\RetargetingAttributeData.cs (3)
18private readonly NamedTypeSymbol? _attributeClass; 25NamedTypeSymbol? attributeClass, 40public override NamedTypeSymbol? AttributeClass => _attributeClass;
Symbols\Attributes\SourceAttributeData.cs (9)
21private readonly NamedTypeSymbol _attributeClass; 33NamedTypeSymbol attributeClass, 61internal SourceAttributeData(CSharpCompilation compilation, AttributeSyntax attributeSyntax, NamedTypeSymbol attributeClass, MethodSymbol? attributeConstructor, bool hasErrors) 78NamedTypeSymbol attributeClass, 89public override NamedTypeSymbol AttributeClass 224internal static int GetTargetAttributeSignatureIndex(CSharpCompilation compilation, NamedTypeSymbol attributeClass, MethodSymbol? attributeConstructor, AttributeDescription description) 295var namedType = (NamedTypeSymbol)parameterType; 473internal static bool IsTargetAttribute(NamedTypeSymbol attributeClass, string namespaceName, string typeName)
Symbols\Attributes\WellKnownAttributeData\TypeWellKnownAttributeData.cs (2)
18private NamedTypeSymbol _comImportCoClass; 19public NamedTypeSymbol ComImportCoClass
Symbols\BaseTypeAnalysis.cs (22)
18internal static bool TypeDependsOn(NamedTypeSymbol depends, NamedTypeSymbol on) 33private static void TypeDependsClosure(NamedTypeSymbol type, CSharpCompilation currentCompilation, HashSet<Symbol> partialClosure) 45foreach (var bt in type.GetDeclaredInterfaces(null)) 63internal static bool StructDependsOn(NamedTypeSymbol depends, NamedTypeSymbol on) 69var hs = PooledHashSet<NamedTypeSymbol>.GetInstance(); 70var typesWithCycle = PooledHashSet<NamedTypeSymbol>.GetInstance(); 71StructDependsClosure(depends, hs, typesWithCycle, ConsList<NamedTypeSymbol>.Empty.Prepend(on)); 80private static void StructDependsClosure(NamedTypeSymbol type, HashSet<NamedTypeSymbol> partialClosure, HashSet<NamedTypeSymbol> typesWithCycle, ConsList<NamedTypeSymbol> on) 112static void visitFields(NamedTypeSymbol type, HashSet<NamedTypeSymbol> partialClosure, HashSet<NamedTypeSymbol> typesWithCycle, ConsList<NamedTypeSymbol> on) 123StructDependsClosure((NamedTypeSymbol)fieldType, partialClosure, typesWithCycle, on); 144internal static ManagedKind GetManagedKind(NamedTypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 173static (bool definitelyManaged, bool hasGenerics) dependsOnDefinitelyManagedType(NamedTypeSymbol type, HashSet<Symbol> partialClosure, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 217NamedTypeSymbol fieldNamedType = fieldType as NamedTypeSymbol;
Symbols\Compilation_WellKnownMembers.cs (15)
26private NamedTypeSymbol?[]? _lazyWellKnownTypes; 99NamedTypeSymbol type = descriptor.IsSpecialTypeMember 121internal NamedTypeSymbol GetWellKnownType(WellKnownType type) 132Interlocked.CompareExchange(ref _lazyWellKnownTypes, new NamedTypeSymbol[(int)WellKnownTypes.Count], null); 137NamedTypeSymbol? result; 226var wkType = GetWellKnownType(wellKnownType); 245internal static Symbol? GetRuntimeMember(NamedTypeSymbol declaringType, in MemberDescriptor descriptor, SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol> comparer, AssemblySymbol? accessWithinOpt) 667var userDefinedAttribute = GetWellKnownType(attributeType); 786NamedTypeSymbol booleanType = GetSpecialType(SpecialType.System_Boolean); 813var attributeTargetsType = GetWellKnownType(WellKnownType.System_AttributeTargets); 1101NamedTypeSymbol named = (NamedTypeSymbol)type; 1119NamedTypeSymbol named = (NamedTypeSymbol)type; 1128return (NamedTypeSymbol)named.OriginalDefinition;
Symbols\ConstraintsHelper.cs (32)
141ImmutableArray<NamedTypeSymbol> interfaces; 143NamedTypeSymbol effectiveBaseClass = corLibrary.GetSpecialType(typeParameter.HasValueTypeConstraint ? SpecialType.System_ValueType : SpecialType.System_Object); 148interfaces = ImmutableArray<NamedTypeSymbol>.Empty; 153var interfacesBuilder = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 163NamedTypeSymbol constraintEffectiveBase; 227AddInterface(interfacesBuilder, (NamedTypeSymbol)constraintType.Type); 233constraintEffectiveBase = (NamedTypeSymbol)constraintType.Type; 275constraintEffectiveBase = (NamedTypeSymbol)constraintType.Type; 589((NamedTypeSymbol)type).CheckConstraints(args); 599this NamedTypeSymbol tuple, 618var underlyingTupleTypeChain = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 619NamedTypeSymbol.GetUnderlyingTypeChain(tuple, underlyingTupleTypeChain); 640offset += NamedTypeSymbol.ValueTupleRestIndex; 656var location = ordinal == NamedTypeSymbol.ValueTupleRestIndex ? typeSyntax.Location : elementLocations[ordinal + offset]; 670this NamedTypeSymbol type, 711public static bool CheckConstraints(this NamedTypeSymbol type, in CheckConstraintsArgs args) 752private static bool HasDuplicateInterfaces(NamedTypeSymbol type, ConsList<TypeSymbol> basesBeingResolved) 781foreach (var i in array) 836NamedTypeSymbol type, 1066if (typeArgument.Type is NamedTypeSymbol { IsInterface: true } iface && SelfOrBaseHasStaticAbstractMember(iface, ref useSiteInfo, out Symbol member)) 1343if (conversions.HasBoxingConversion(typeArgument.Type.IsNullableType() ? ((NamedTypeSymbol)typeArgument.Type).ConstructedFrom : typeArgument.Type, 1349if (typeArgument.Type is NamedTypeSymbol { IsRefLikeType: true } refLike && 1381private static bool SelfOrBaseHasStaticAbstractMember(NamedTypeSymbol iface, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out Symbol memberWithoutImplementation) 1428private static void AddInterfaces(ArrayBuilder<NamedTypeSymbol> builder, ImmutableArray<NamedTypeSymbol> interfaces) 1430foreach (var @interface in interfaces) 1436private static void AddInterface(ArrayBuilder<NamedTypeSymbol> builder, NamedTypeSymbol @interface) 1457return SatisfiesPublicParameterlessConstructor((NamedTypeSymbol)typeArgument, synthesizedIfMissing: true); 1469return SatisfiesPublicParameterlessConstructor((NamedTypeSymbol)typeArgument, synthesizedIfMissing: false); 1486private static ConstructorConstraintError SatisfiesPublicParameterlessConstructor(NamedTypeSymbol type, bool synthesizedIfMissing) 1549public static bool RequiresChecking(NamedTypeSymbol type)
Symbols\ConstructedNamedTypeSymbol.cs (7)
20internal SubstitutedNestedTypeSymbol(SubstitutedNamedTypeSymbol newContainer, NamedTypeSymbol originalDefinition) 38public override NamedTypeSymbol ConstructedFrom 48protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 60private readonly NamedTypeSymbol _constructedFrom; 62internal ConstructedNamedTypeSymbol(NamedTypeSymbol constructedFrom, ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, bool unbound = false, TupleExtraData tupleData = null) 75protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 80public override NamedTypeSymbol ConstructedFrom
Symbols\CustomModifier.cs (9)
17protected readonly NamedTypeSymbol modifier; 19private CSharpCustomModifier(NamedTypeSymbol modifier) 36public NamedTypeSymbol ModifierSymbol 48internal static CustomModifier CreateOptional(NamedTypeSymbol modifier) 53internal static CustomModifier CreateRequired(NamedTypeSymbol modifier) 69var modifier = (NamedTypeSymbol)customModifier.Modifier; 75public OptionalCustomModifier(NamedTypeSymbol modifier) 107public RequiredCustomModifier(NamedTypeSymbol modifier)
Symbols\DynamicTypeSymbol.cs (9)
86internal override NamedTypeSymbol? BaseTypeNoUseSiteDiagnostics => null; 88internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved) 90return ImmutableArray<NamedTypeSymbol>.Empty; 142public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 144return ImmutableArray<NamedTypeSymbol>.Empty; 147public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 149return ImmutableArray<NamedTypeSymbol>.Empty; 209var other = t2 as NamedTypeSymbol;
Symbols\ErrorTypeSymbol.cs (27)
184public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 186return ImmutableArray<NamedTypeSymbol>.Empty; 195public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 197return ImmutableArray<NamedTypeSymbol>.Empty; 206public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 208return ImmutableArray<NamedTypeSymbol>.Empty; 348public override NamedTypeSymbol ConstructedFrom 434internal override NamedTypeSymbol? BaseTypeNoUseSiteDiagnostics => null; 446internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved) 448return ImmutableArray<NamedTypeSymbol>.Empty; 451internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() 453return ImmutableArray<NamedTypeSymbol>.Empty; 456internal override NamedTypeSymbol? GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 461internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 463return ImmutableArray<NamedTypeSymbol>.Empty; 466protected override NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 471internal override NamedTypeSymbol AsMember(NamedTypeSymbol newOwner) 543internal override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 545internal override NamedTypeSymbol? NativeIntegerUnderlyingType => null; 598public override NamedTypeSymbol OriginalDefinition 670protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 685public override NamedTypeSymbol ConstructedFrom 703private readonly NamedTypeSymbol _containingSymbol; 707public SubstitutedNestedErrorTypeSymbol(NamedTypeSymbol containingSymbol, ErrorTypeSymbol originalDefinition) : 724public override NamedTypeSymbol ConstructedFrom 739protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (3)
167internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 169return ImmutableArray<NamedTypeSymbol>.Empty; 172internal override NamedTypeSymbol? GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\EventSymbol.cs (2)
167internal EventSymbol GetLeastOverriddenEvent(NamedTypeSymbol? accessingTypeOpt) 260internal EventSymbol AsMember(NamedTypeSymbol newOwner)
Symbols\ExtendedErrorTypeSymbol.cs (7)
94protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 167public override NamedTypeSymbol OriginalDefinition 184public override NamedTypeSymbol ConstructedFrom 192internal override NamedTypeSymbol? GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 197internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 199return ImmutableArray<NamedTypeSymbol>.Empty; 318return ((NamedTypeSymbol)symbol).Arity;
Symbols\FieldSymbol.cs (5)
122internal virtual NamedTypeSymbol FixedImplementationType(PEModuleBuilder emitModule) 327internal virtual FieldSymbol AsMember(NamedTypeSymbol newOwner) 484var tupleElementPosition = NamedTypeSymbol.MatchesCanonicalTupleElementName(Name); 491Debug.Assert(tupleElementPosition < NamedTypeSymbol.ValueTupleRestPosition); 493WellKnownMember wellKnownMember = NamedTypeSymbol.GetTupleTypeMember(arity, tupleElementPosition);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (6)
210NamedTypeSymbol? specifierType; 314var attributeType = refKind switch 639internal override ImmutableArray<NamedTypeSymbol> UnmanagedCallingConventionTypes 645return ImmutableArray<NamedTypeSymbol>.Empty; 651return ImmutableArray<NamedTypeSymbol>.Empty; 654var builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(modifiersToSearch.Length);
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (8)
87internal override NamedTypeSymbol? BaseTypeNoUseSiteDiagnostics => null; 94public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 95public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 97internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty; 206internal static bool IsCallingConventionModifier(NamedTypeSymbol modifierType)
Symbols\FunctionTypeSymbol.cs (24)
37private static readonly NamedTypeSymbol Uninitialized = new UnsupportedMetadataTypeSymbol(); 40private readonly Func<Binder, BoundExpression, NamedTypeSymbol?>? _calculateDelegate; 43private NamedTypeSymbol? _lazyDelegateType; 45internal static FunctionTypeSymbol? CreateIfFeatureEnabled(SyntaxNode syntax, Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate) 52private FunctionTypeSymbol(Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate) 59internal FunctionTypeSymbol(NamedTypeSymbol delegateType) 77internal NamedTypeSymbol? GetInternalDelegateType() 85var delegateType = _calculateDelegate(_binder, _expression); 86var result = Interlocked.CompareExchange(ref _lazyDelegateType, delegateType, Uninitialized); 124internal override NamedTypeSymbol? BaseTypeNoUseSiteDiagnostics => null; 140public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => throw ExceptionUtilities.Unreachable(); 142public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => throw ExceptionUtilities.Unreachable(); 158internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty; 164var thisDelegateType = GetInternalDelegateType(); 166var otherDelegateType = otherType.GetInternalDelegateType(); 173var mergedDelegateType = (NamedTypeSymbol)thisDelegateType.MergeEquivalentTypes(otherDelegateType, variance); 181var thisDelegateType = GetInternalDelegateType(); 186return WithDelegateType((NamedTypeSymbol)thisDelegateType.SetNullabilityForReferenceTypes(transform)); 189private FunctionTypeSymbol WithDelegateType(NamedTypeSymbol delegateType) 191var thisDelegateType = GetInternalDelegateType(); 214var thisDelegateType = GetInternalDelegateType(); 215var otherDelegateType = otherType.GetInternalDelegateType();
Symbols\MemberSymbolExtensions.cs (7)
267internal static Symbol SymbolAsMember(this Symbol s, NamedTypeSymbol newOwner) 276return ((NamedTypeSymbol)s).AsMember(newOwner); 298return ((NamedTypeSymbol)symbol).Arity; 330return ((NamedTypeSymbol)symbol).TypeParameters; 348return ((NamedTypeSymbol)symbol).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.SelectAsArray(TypeMap.AsTypeSymbol); 404internal static bool IsDefaultValueTypeConstructor(this NamedTypeSymbol type, ConstructorInitializerSyntax initializerSyntax) 622internal static Symbol GetLeastOverriddenMember(this Symbol member, NamedTypeSymbol accessingTypeOpt)
Symbols\MergedNamespaceSymbol.cs (9)
234internal sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 236return ImmutableArray.CreateRange<NamedTypeSymbol>(GetMembersUnordered().OfType<NamedTypeSymbol>()); 239public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 241return ImmutableArray.CreateRange<NamedTypeSymbol>(GetMembers().OfType<NamedTypeSymbol>()); 244public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 247return ImmutableArray.CreateRange<NamedTypeSymbol>(_cachedLookup[name].OfType<NamedTypeSymbol>());
Symbols\Metadata\PE\DynamicTypeDecoder.cs (5)
161return TransformNamedType((NamedTypeSymbol)type); 215private NamedTypeSymbol TransformNamedType(NamedTypeSymbol namedType, bool isContaining = false) 224NamedTypeSymbol containingType = namedType.ContainingType; 225NamedTypeSymbol newContainingType;
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (4)
66NamedTypeSymbol namedType = _containingType as NamedTypeSymbol; 86private static void GetGenericTypeParameterSymbol(int position, NamedTypeSymbol namedType, out int cumulativeArity, out TypeParameterSymbol typeArgument) 93var containingType = namedType.ContainingType;
Symbols\Metadata\PE\MetadataDecoder.cs (11)
120var result = container.LookupMetadataType(ref emittedName); 123return result ?? new MissingMetadataTypeSymbol.Nested((NamedTypeSymbol)container, ref emittedName); 168var result = m.LookupTopLevelMetadataType(ref emittedName); 233var namedType = (NamedTypeSymbol)symbol; 329internal static NamedTypeSymbol SubstituteNoPiaLocalType( 338NamedTypeSymbol? result = null; 371NamedTypeSymbol? candidate = assembly.LookupDeclaredTopLevelMetadataType(ref name); 550? scope.AllInterfacesNoUseSiteDiagnostics.IndexOf((NamedTypeSymbol)targetTypeSymbol, 0, SymbolEqualityComparer.CLRSignature) != -1 570return definition.SymbolAsMember((NamedTypeSymbol)targetTypeSymbol); 578foreach (NamedTypeSymbol @interface in typeSymbol.InterfacesNoUseSiteDiagnostics())
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (4)
100return TransformNamedType((NamedTypeSymbol)type); 108private NamedTypeSymbol? TransformNamedType(NamedTypeSymbol type) 148NamedTypeSymbol result = haveChanges ? type.WithTypeArguments(allTypeArguments.ToImmutable()) : type;
Symbols\Metadata\PE\PEAssemblySymbol.cs (2)
177internal override IEnumerable<NamedTypeSymbol> GetAllTopLevelForwardedTypes() 184internal override NamedTypeSymbol? TryLookupForwardedMetadataTypeWithCycleDetection(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies)
Symbols\Metadata\PE\PEEventSymbol.cs (4)
168NamedTypeSymbol eventRegistrationTokenTable_T = ((PEModuleSymbol)(this.ContainingModule)).EventRegistrationTokenTable_T; 170TypeSymbol.Equals(_eventTypeWithAnnotations.Type, ((NamedTypeSymbol)candidateAssociatedFieldType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type, TypeCompareKind.ConsiderEverything2)) 191NamedTypeSymbol token = ((PEModuleSymbol)(this.ContainingModule)).EventRegistrationToken; 225public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PEFieldSymbol.cs (4)
129private NamedTypeSymbol _lazyFixedImplementationType; 170public override NamedTypeSymbol ContainingType 336_lazyFixedImplementationType = type.Type as NamedTypeSymbol; 443internal override NamedTypeSymbol FixedImplementationType(PEModuleBuilder emitModule)
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
446public override NamedTypeSymbol ContainingType => _containingType;
Symbols\Metadata\PE\PEModuleSymbol.cs (14)
50private NamedTypeSymbol? _lazySystemTypeSymbol; 51private NamedTypeSymbol? _lazyEventRegistrationTokenSymbol; 52private NamedTypeSymbol? _lazyEventRegistrationTokenTableSymbol; 552internal NamedTypeSymbol EventRegistrationToken 569internal NamedTypeSymbol EventRegistrationTokenTable_T 586internal NamedTypeSymbol SystemTypeSymbol 601private NamedTypeSymbol GetTypeSymbolForWellKnownType(WellKnownType type) 605NamedTypeSymbol? currentModuleResult = this.LookupTopLevelMetadataType(ref emittedName); 618NamedTypeSymbol? referencedAssemblyResult = null; 621NamedTypeSymbol currResult = assembly.LookupDeclaredOrForwardedTopLevelMetadataType(ref emittedName, visitedAssemblies: null); 651static bool isAcceptableSystemTypeSymbol(NamedTypeSymbol candidate) 701internal NamedTypeSymbol LookupTopLevelMetadataTypeWithNoPiaLocalTypeUnification(ref MetadataTypeName emittedName, out bool isNoPiaLocalType) 703NamedTypeSymbol? result; 764internal IEnumerable<NamedTypeSymbol> GetForwardedTypes()
Symbols\Metadata\PE\PENamedTypeSymbol.cs (53)
74private NamedTypeSymbol _lazyBaseType = ErrorTypeSymbol.UnknownResultType; 75private ImmutableArray<NamedTypeSymbol> _lazyInterfaces = default(ImmutableArray<NamedTypeSymbol>); 76private NamedTypeSymbol _lazyDeclaredBaseType = ErrorTypeSymbol.UnknownResultType; 77private ImmutableArray<NamedTypeSymbol> _lazyDeclaredInterfaces = default(ImmutableArray<NamedTypeSymbol>); 134internal NamedTypeSymbol lazyEnumUnderlyingType; 145internal NamedTypeSymbol lazyComImportCoClassType = ErrorTypeSymbol.UnknownResultType; 471internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics 484internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved = null) 488ImmutableInterlocked.InterlockedCompareExchange(ref _lazyInterfaces, MakeAcyclicInterfaces(), default(ImmutableArray<NamedTypeSymbol>)); 494internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() 499internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 504private NamedTypeSymbol GetDeclaredBaseType(bool skipTransformsIfNecessary) 508var baseType = MakeDeclaredBaseType(); 522baseType = (NamedTypeSymbol)NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(decodedType), _handle, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 531internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 535ImmutableInterlocked.InterlockedCompareExchange(ref _lazyDeclaredInterfaces, MakeDeclaredInterfaces(), default(ImmutableArray<NamedTypeSymbol>)); 541private NamedTypeSymbol MakeDeclaredBaseType() 551return (NamedTypeSymbol)new MetadataDecoder(moduleSymbol, this).GetTypeOfToken(token); 563private ImmutableArray<NamedTypeSymbol> MakeDeclaredInterfaces() 572var symbols = ArrayBuilder<NamedTypeSymbol>.GetInstance(interfaceImpls.Count); 584var namedTypeSymbol = typeSymbol as NamedTypeSymbol ?? new UnsupportedMetadataTypeSymbol(); // interface list contains a bad type 591return ImmutableArray<NamedTypeSymbol>.Empty; 595return ImmutableArray.Create<NamedTypeSymbol>(new UnsupportedMetadataTypeSymbol(mrEx)); 599public override NamedTypeSymbol ConstructedFrom 615public override NamedTypeSymbol ContainingType 619return _container as NamedTypeSymbol; 680public override NamedTypeSymbol EnumUnderlyingType 1206NamedTypeSymbol underlyingType = null; 1235underlyingType = (NamedTypeSymbol)type; 1544internal override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 1549public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 1555private ImmutableArray<NamedTypeSymbol> GetMemberTypesPrivate() 1557var builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 1586public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 1594return StaticCast<NamedTypeSymbol>.From(t); 1597return ImmutableArray<NamedTypeSymbol>.Empty; 1600public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 1823private NamedTypeSymbol MakeAcyclicBaseType() 1825NamedTypeSymbol declaredBase = GetDeclaredBaseType(null); 1842private ImmutableArray<NamedTypeSymbol> MakeAcyclicInterfaces() 2344internal override NamedTypeSymbol ComImportCoClass 2362var coClassType = ((object)type != null && (type.TypeKind == TypeKind.Class || type.IsErrorType())) ? (NamedTypeSymbol)type : null; 2556protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 2584internal override NamedTypeSymbol AsNativeInteger() 2595internal override NamedTypeSymbol NativeIntegerUnderlyingType => null; 2641protected sealed override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 2686internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 2688internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => null; 2738var container = this.ContainingType;
Symbols\Metadata\PE\PENamespaceSymbol.cs (10)
96private ImmutableArray<NamedTypeSymbol> GetMemberTypesPrivate() 105return StaticCast<NamedTypeSymbol>.From(_lazyFlattenedTypes); 147public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 154public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 161? StaticCast<NamedTypeSymbol>.From(t) 162: ImmutableArray<NamedTypeSymbol>.Empty; 165public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 330internal NamedTypeSymbol? UnifyIfNoPiaLocalType(ref MetadataTypeName emittedTypeName) 339var result = (NamedTypeSymbol)new MetadataDecoder(ContainingPEModule).GetTypeOfToken(typeDef, out bool isNoPiaLocalType);
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
867else if (paramNames.IsDefault || Type is not NamedTypeSymbol { IsInterpolatedStringHandlerType: true })
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
406public override NamedTypeSymbol ContainingType
Symbols\Metadata\PE\PETypeParameterSymbol.cs (4)
622internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 625return (bounds != null) ? bounds.Interfaces : ImmutableArray<NamedTypeSymbol>.Empty; 628internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 708private NamedTypeSymbol GetDefaultBaseType()
Symbols\Metadata\PE\SymbolFactory.cs (6)
100NamedTypeSymbol genericType = (NamedTypeSymbol)genericTypeDef; 109NamedTypeSymbol typeToCheck = genericType; 151NamedTypeSymbol constructedType = substitution.SubstituteNamedType(genericType); 163var namedType = type as NamedTypeSymbol;
Symbols\Metadata\PE\TupleTypeDecoder.cs (8)
28/// a <see cref="NamedTypeSymbol"/> with attached names. 194return DecodeNamedType((NamedTypeSymbol)type); 250private NamedTypeSymbol DecodeNamedType(NamedTypeSymbol type) 256NamedTypeSymbol decodedType = type; 259NamedTypeSymbol containingType = type.ContainingType; 260NamedTypeSymbol? decodedContainingType; 299decodedType = NamedTypeSymbol.CreateTuple(decodedType, elementNames);
Symbols\MetadataOrSourceAssemblySymbol.cs (8)
27private NamedTypeSymbol[] _lazySpecialTypes; 45internal sealed override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) 58NamedTypeSymbol? result = module.LookupTopLevelMetadataType(ref emittedName); 80internal sealed override void RegisterDeclaredSpecialType(NamedTypeSymbol corType) 91new NamedTypeSymbol[(int)InternalSpecialType.NextAvailable], null); 135internal sealed override NamedTypeSymbol GetNativeIntegerType(NamedTypeSymbol underlyingType) 205NamedTypeSymbol type = GetDeclaredSpecialType(descriptor.DeclaringSpecialType);
Symbols\MethodSymbol.cs (8)
414internal MethodSymbol GetLeastOverriddenMethod(NamedTypeSymbol accessingTypeOpt) 425private MethodSymbol GetLeastOverriddenMethodCore(NamedTypeSymbol accessingTypeOpt, bool requireSameReturnType) 473internal MethodSymbol GetConstructedLeastOverriddenMethod(NamedTypeSymbol accessingTypeOpt, bool requireSameReturnType) 869if (typeArguments.Any(NamedTypeSymbol.TypeWithAnnotationsIsNullFunction)) 887internal MethodSymbol AsMember(NamedTypeSymbol newOwner) 925internal virtual ImmutableArray<NamedTypeSymbol> UnmanagedCallingConventionTypes => ImmutableArray<NamedTypeSymbol>.Empty; 1013if (!(callConvTypedConstant.ValueInternal is NamedTypeSymbol callConvType)
Symbols\MethodSymbolExtensions.cs (3)
160&& method.ReturnType is NamedTypeSymbol { Arity: 0 } 170&& method.ReturnType is NamedTypeSymbol { Arity: 1 } 219method.ContainingType is NamedTypeSymbol containingType &&
Symbols\MissingAssemblySymbol.cs (5)
170internal override NamedTypeSymbol LookupDeclaredOrForwardedTopLevelMetadataType(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies) 175internal override NamedTypeSymbol? LookupDeclaredTopLevelMetadataType(ref MetadataTypeName emittedName) 182internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) 214internal sealed override IEnumerable<NamedTypeSymbol> GetAllTopLevelForwardedTypes() 216return SpecializedCollections.EmptyEnumerable<NamedTypeSymbol>();
Symbols\MissingCorLibrarySymbol.cs (4)
30private NamedTypeSymbol[] _lazySpecialTypes; 60internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) 72new NamedTypeSymbol[(int)InternalSpecialType.NextAvailable], null); 78NamedTypeSymbol corType = new MissingMetadataTypeSymbol.TopLevel(this.moduleSymbol, ref emittedFullName, type);
Symbols\MissingMetadataTypeSymbol.cs (8)
206protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 343internal sealed override NamedTypeSymbol AsNativeInteger() => AsNativeInteger(asNativeInt: true); 364internal sealed override NamedTypeSymbol? NativeIntegerUnderlyingType => _isNativeInt ? AsNativeInteger(asNativeInt: false) : null; 406private readonly NamedTypeSymbol _containingType; 408public Nested(NamedTypeSymbol containingType, string name, int arity, bool mangleName) 416public Nested(NamedTypeSymbol containingType, ref MetadataTypeName emittedName) 421private Nested(NamedTypeSymbol containingType, ref MetadataTypeName emittedName, bool mangleName) 445protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
Symbols\MissingModuleSymbol.cs (1)
147internal override NamedTypeSymbol? LookupTopLevelMetadataType(ref MetadataTypeName emittedName)
Symbols\MissingNamespaceSymbol.cs (6)
110public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 112return ImmutableArray<NamedTypeSymbol>.Empty; 115public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 117return ImmutableArray<NamedTypeSymbol>.Empty; 120public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 122return ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\ModuleSymbol.cs (1)
303internal abstract NamedTypeSymbol? LookupTopLevelMetadataType(ref MetadataTypeName emittedName);
Symbols\NamedTypeSymbol.cs (49)
96public abstract NamedTypeSymbol ConstructedFrom { get; } 102public virtual NamedTypeSymbol EnumUnderlyingType 110public override NamedTypeSymbol ContainingType 118return this.ContainingSymbol as NamedTypeSymbol; 672public abstract override ImmutableArray<NamedTypeSymbol> GetTypeMembers(); 680public abstract override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity); 763internal abstract NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved); 765internal abstract ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved); 801NamedTypeSymbol other = t2 as NamedTypeSymbol; 805var thisOriginalDefinition = this.OriginalDefinition; 806var otherOriginalDefinition = other.OriginalDefinition; 840private bool EqualsComplicatedCases(NamedTypeSymbol other, TypeCompareKind comparison) 896bool tupleNamesEquals(NamedTypeSymbol other, TypeCompareKind comparison) 976NamedTypeSymbol result = haveChanges ? this.WithTypeArguments(allTypeArguments.ToImmutable()) : this; 981internal NamedTypeSymbol WithTypeArguments(ImmutableArray<TypeWithAnnotations> allTypeArguments) 983var definition = this.OriginalDefinition; 999bool haveChanges = MergeEquivalentTypeArguments(this, (NamedTypeSymbol)other, variance, allTypeParameters, allTypeArguments); 1001NamedTypeSymbol result; 1015return IsTupleType ? MergeTupleNames((NamedTypeSymbol)other, result) : result; 1025NamedTypeSymbol typeA, 1026NamedTypeSymbol typeB, 1037var definition = typeA.OriginalDefinition; 1100public NamedTypeSymbol Construct(params TypeSymbol[] typeArguments) 1111public NamedTypeSymbol Construct(ImmutableArray<TypeSymbol> typeArguments) 1121public NamedTypeSymbol Construct(IEnumerable<TypeSymbol> typeArguments) 1130public NamedTypeSymbol ConstructUnboundGenericType() 1135internal NamedTypeSymbol GetUnboundGenericTypeOrSelf() 1161private NamedTypeSymbol ConstructWithoutModifiers(ImmutableArray<TypeSymbol> typeArguments, bool unbound) 1177internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 1182internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1219protected virtual NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1231for (var current = this; !ReferenceEquals(current, null); current = current.ContainingType) 1262var outer = ContainingType; 1283var outer = ContainingType; 1302var outer = ContainingType; 1321public new virtual NamedTypeSymbol OriginalDefinition 1347internal virtual NamedTypeSymbol AsMember(NamedTypeSymbol newOwner) 1376NamedTypeSymbol currentType = this; 1421NamedTypeSymbol @base = this.BaseTypeNoUseSiteDiagnostics; 1458var @base = this.BaseTypeNoUseSiteDiagnostics; 1522var baseType = this.BaseTypeNoUseSiteDiagnostics; 1591internal virtual NamedTypeSymbol ComImportCoClass 1655typeToCheck = ((NamedTypeSymbol)typeToCheck).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestPosition - 1].Type; 1659arity = (typeToCheck as NamedTypeSymbol)?.Arity ?? 0; 1661if (arity > 0 && arity < ValueTupleRestPosition && ((NamedTypeSymbol)typeToCheck).IsTupleTypeOfCardinality(out tupleCardinality)) 1680internal abstract NamedTypeSymbol AsNativeInteger(); 1687internal abstract NamedTypeSymbol NativeIntegerUnderlyingType { get; }
Symbols\NamespaceOrTypeSymbol.cs (14)
139internal virtual ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 152public abstract ImmutableArray<NamedTypeSymbol> GetTypeMembers(); 160public ImmutableArray<NamedTypeSymbol> GetTypeMembers(string name) 169public ImmutableArray<NamedTypeSymbol> GetTypeMembers(string name, int arity) 173public abstract ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name); 176public virtual ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 214foreach (var member in GetTypeMembers(name, arity)) 254internal virtual NamedTypeSymbol? LookupMetadataType(ref MetadataTypeName emittedTypeName) 260Debug.Assert(scope is NamespaceSymbol or NamedTypeSymbol); 267NamedTypeSymbol? namedType = null; 269ImmutableArray<NamedTypeSymbol> namespaceOrTypeMembers; 283foreach (var named in namespaceOrTypeMembers) 331foreach (var named in namespaceOrTypeMembers) 360foreach (var named in namespaceOrTypeMembers)
Symbols\NamespaceSymbol.cs (5)
23private ImmutableArray<NamedTypeSymbol> _lazyTypesMightContainExtensionMethods; 90public sealed override NamedTypeSymbol ContainingType 224internal NamedTypeSymbol ImplicitType 310private ImmutableArray<NamedTypeSymbol> TypesMightContainExtensionMethods 348foreach (var type in typesWithExtensionMethods)
Symbols\NativeIntegerTypeSymbol.cs (22)
25private ImmutableArray<NamedTypeSymbol> _lazyInterfaces; 29internal NativeIntegerTypeSymbol(NamedTypeSymbol underlyingType) : base(underlyingType, tupleData: null) 40public override NamedTypeSymbol ConstructedFrom => this; 48internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => _underlyingType.BaseTypeNoUseSiteDiagnostics; 142public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 144public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 146public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => ImmutableArray<NamedTypeSymbol>.Empty; 148internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => _underlyingType.GetDeclaredBaseType(basesBeingResolved); 150internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => GetInterfaces(basesBeingResolved); 158internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => throw ExceptionUtilities.Unreachable(); 160internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => GetInterfaces(basesBeingResolved); 162protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) => throw ExceptionUtilities.Unreachable(); 175internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 177internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => _underlyingType; 216private ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeSymbol>? basesBeingResolved) 243internal NamedTypeSymbol SubstituteUnderlyingType(NamedTypeSymbol type) => GetTypeMap().SubstituteNamedType(type); 311internal override NamedTypeSymbol SubstituteTypeDeclaration(NamedTypeSymbol previous)
Symbols\NonMissingAssemblySymbol.cs (15)
32private readonly ConcurrentDictionary<MetadataTypeName.Key, NamedTypeSymbol> _emittedNameToTypeMap = 33new ConcurrentDictionary<MetadataTypeName.Key, NamedTypeSymbol>(); 80internal sealed override NamedTypeSymbol? LookupDeclaredTopLevelMetadataType(ref MetadataTypeName emittedName) 82NamedTypeSymbol? result = null; 133private NamedTypeSymbol? LookupDeclaredTopLevelMetadataTypeInModules(ref MetadataTypeName emittedName) 140NamedTypeSymbol? result = module.LookupTopLevelMetadataType(ref emittedName); 161internal sealed override NamedTypeSymbol LookupDeclaredOrForwardedTopLevelMetadataType(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies) 163NamedTypeSymbol? result = LookupTopLevelMetadataTypeInCache(ref emittedName); 186internal abstract override NamedTypeSymbol? TryLookupForwardedMetadataTypeWithCycleDetection(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies); 188private NamedTypeSymbol? LookupTopLevelMetadataTypeInCache(ref MetadataTypeName emittedName) 190NamedTypeSymbol? result; 202internal NamedTypeSymbol CachedTypeByEmittedName(string emittedname) 219private NamedTypeSymbol CacheTopLevelMetadataType( 221NamedTypeSymbol result) 223NamedTypeSymbol result1;
Symbols\NonMissingModuleSymbol.cs (2)
188internal sealed override NamedTypeSymbol? LookupTopLevelMetadataType(ref MetadataTypeName emittedName) 190NamedTypeSymbol? result;
Symbols\NoPiaAmbiguousCanonicalTypeSymbol.cs (7)
23private readonly NamedTypeSymbol _firstCandidate; 24private readonly NamedTypeSymbol _secondCandidate; 28NamedTypeSymbol firstCandidate, 29NamedTypeSymbol secondCandidate, 38protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 63public NamedTypeSymbol FirstCandidate 71public NamedTypeSymbol SecondCandidate
Symbols\NoPiaIllegalGenericInstantiationSymbol.cs (4)
22private readonly NamedTypeSymbol _underlyingSymbol; 24public NoPiaIllegalGenericInstantiationSymbol(ModuleSymbol exposingModule, NamedTypeSymbol underlyingSymbol) 30protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 47public NamedTypeSymbol UnderlyingSymbol
Symbols\NoPiaMissingCanonicalTypeSymbol.cs (1)
45protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
Symbols\OverriddenOrHiddenMembersHelpers.cs (17)
114NamedTypeSymbol containingType = member.ContainingType; 142private static void FindOverriddenOrHiddenMembers(Symbol member, NamedTypeSymbol containingType, bool memberIsFromSomeCompilation, 159for (NamedTypeSymbol currType = containingType.BaseTypeNoUseSiteDiagnostics; 413NamedTypeSymbol containingType = member.ContainingType; 416PooledHashSet<NamedTypeSymbol> membersOfOtherKindsHidden = PooledHashSet<NamedTypeSymbol>.GetInstance(); 417PooledHashSet<NamedTypeSymbol> allMembersHidden = PooledHashSet<NamedTypeSymbol>.GetInstance(); // Implies membersOfOtherKindsHidden. 421foreach (NamedTypeSymbol currType in containingType.AllInterfacesNoUseSiteDiagnostics) // NB: topologically sorted 448foreach (var hidden in currType.AllInterfacesNoUseSiteDiagnostics) 465foreach (var hidden in currType.AllInterfacesNoUseSiteDiagnostics) 480foreach (var hidden in currType.AllInterfacesNoUseSiteDiagnostics) 535NamedTypeSymbol memberContainingType, 537NamedTypeSymbol currType, 1027NamedTypeSymbol containingType = method.ContainingType; 1029for (NamedTypeSymbol currType = containingType.BaseTypeNoUseSiteDiagnostics; !ReferenceEquals(currType, null); currType = currType.BaseTypeNoUseSiteDiagnostics) 1070private static bool IsOverriddenSymbolAccessible(Symbol overridden, NamedTypeSymbol overridingContainingType)
Symbols\OverriddenOrHiddenMembersResult.cs (3)
60NamedTypeSymbol overriddenByDefinitionContaining = overriddenByDefinitionMember.ContainingType; 61NamedTypeSymbol overriddenByDefinitionContainingTypeDefinition = overriddenByDefinitionContaining.OriginalDefinition; 62for (NamedTypeSymbol baseType = substitutedOverridingMember.ContainingType.BaseTypeNoUseSiteDiagnostics;
Symbols\PlaceholderTypeArgumentSymbol.cs (1)
29protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
Symbols\PointerTypeSymbol.cs (9)
78internal override NamedTypeSymbol? BaseTypeNoUseSiteDiagnostics 87internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved) 90return ImmutableArray<NamedTypeSymbol>.Empty; 142public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 144return ImmutableArray<NamedTypeSymbol>.Empty; 147public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 149return ImmutableArray<NamedTypeSymbol>.Empty; 152public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 154return ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\PropertySymbol.cs (2)
264internal PropertySymbol GetLeastOverriddenProperty(NamedTypeSymbol accessingTypeOpt) 379internal PropertySymbol AsMember(NamedTypeSymbol newOwner)
Symbols\PublicModel\ErrorTypeSymbol.cs (1)
32internal override Symbols.NamedTypeSymbol UnderlyingNamedTypeSymbol => _underlying;
Symbols\PublicModel\NamedTypeSymbol.cs (3)
22internal abstract Symbols.NamedTypeSymbol UnderlyingNamedTypeSymbol { get; } 175var type = UnderlyingNamedTypeSymbol; 176var tupleUnderlyingType = type.TupleUnderlyingType;
Symbols\PublicModel\NonErrorNamedTypeSymbol.cs (3)
13private readonly Symbols.NamedTypeSymbol _underlying; 15public NonErrorNamedTypeSymbol(Symbols.NamedTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation) 33internal override Symbols.NamedTypeSymbol UnderlyingNamedTypeSymbol => _underlying;
Symbols\Retargeting\RetargetingAssemblySymbol.cs (11)
75private ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol> _noPiaUnificationMap; 80internal ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol> NoPiaUnificationMap => 81LazyInitializer.EnsureInitialized(ref _noPiaUnificationMap, () => new ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol>(concurrencyLevel: 2, capacity: 0)); 221internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) 296internal override NamedTypeSymbol? TryLookupForwardedMetadataTypeWithCycleDetection(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies) 298NamedTypeSymbol? underlying = _underlyingAssembly.TryLookupForwardedMetadataTypeWithCycleDetection(ref emittedName, visitedAssemblies: null); 310internal override IEnumerable<NamedTypeSymbol> GetAllTopLevelForwardedTypes() 312foreach (NamedTypeSymbol underlying in _underlyingAssembly.GetAllTopLevelForwardedTypes())
Symbols\Retargeting\RetargetingMethodSymbol.cs (1)
246builder.Add((INamedTypeSymbolInternal)RetargetingTranslator.Retarget((NamedTypeSymbol)identifier));
Symbols\Retargeting\RetargetingModuleSymbol.cs (4)
57private ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol>? _symbolMap; 59public ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol> SymbolMap => LazyInitializer.EnsureInitialized(ref _symbolMap);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (32)
31private NamedTypeSymbol _lazyBaseType = ErrorTypeSymbol.UnknownResultType; 32private ImmutableArray<NamedTypeSymbol> _lazyInterfaces = default(ImmutableArray<NamedTypeSymbol>); 34private NamedTypeSymbol _lazyDeclaredBaseType = ErrorTypeSymbol.UnknownResultType; 35private ImmutableArray<NamedTypeSymbol> _lazyDeclaredInterfaces; 41public RetargetingNamedTypeSymbol(RetargetingModuleSymbol retargetingModule, NamedTypeSymbol underlyingType, TupleExtraData tupleData = null) 50protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 93public override NamedTypeSymbol ConstructedFrom 101public override NamedTypeSymbol EnumUnderlyingType 105var underlying = _underlyingType.EnumUnderlyingType; 194internal override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 199public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 204public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 209public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 250internal override NamedTypeSymbol? LookupMetadataType(ref MetadataTypeName typeName) 252NamedTypeSymbol? underlyingResult = _underlyingType.LookupMetadataType(ref typeName); 273internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics 279NamedTypeSymbol acyclicBase = GetDeclaredBaseType(null); 284var underlyingBase = _underlyingType.BaseTypeNoUseSiteDiagnostics; 303internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 314ImmutableArray<NamedTypeSymbol> result = declaredInterfaces 317ImmutableInterlocked.InterlockedCompareExchange(ref _lazyInterfaces, result, default(ImmutableArray<NamedTypeSymbol>)); 323internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() 328internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 332var underlyingBase = _underlyingType.GetDeclaredBaseType(basesBeingResolved); 333var declaredBase = (object)underlyingBase != null ? this.RetargetingTranslator.Retarget(underlyingBase, RetargetOptions.RetargetPrimitiveTypesByName) : null; 340internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 346ImmutableInterlocked.InterlockedCompareExchange(ref _lazyDeclaredInterfaces, result, default(ImmutableArray<NamedTypeSymbol>)); 363internal override NamedTypeSymbol ComImportCoClass 367NamedTypeSymbol coClass = _underlyingType.ComImportCoClass; 390internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 392internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => null;
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (11)
85if (s.Kind == SymbolKind.NamedType && ((NamedTypeSymbol)s).IsExplicitDefinitionOfNoPiaLocalType) 106internal override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 111public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 116private ImmutableArray<NamedTypeSymbol> RetargetTypeMembers(ImmutableArray<NamedTypeSymbol> underlyingMembers) 118var builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(underlyingMembers.Length); 120foreach (NamedTypeSymbol t in underlyingMembers) 135public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 140public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 208internal override NamedTypeSymbol? LookupMetadataType(ref MetadataTypeName typeName) 213NamedTypeSymbol? underlying = _underlyingNamespace.LookupMetadataType(ref typeName);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (56)
57return new RetargetingNamedTypeSymbol(this, (NamedTypeSymbol)symbol); 164Debug.Assert(symbol.Kind != SymbolKind.NamedType || ((NamedTypeSymbol)symbol).PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 180public TypeWithAnnotations Retarget(TypeWithAnnotations underlyingType, RetargetOptions options, NamedTypeSymbol asDynamicIfNoPiaContainingType = null) 205private NamedTypeSymbol RetargetNamedTypeDefinition(NamedTypeSymbol type, RetargetOptions options) 211var result = RetargetNamedTypeDefinition(type.NativeIntegerUnderlyingType, options); 276private NamedTypeSymbol RetargetNamedTypeDefinitionFromUnderlyingAssembly(NamedTypeSymbol type) 285var container = type.ContainingType; 292return (NamedTypeSymbol)this.SymbolMap.GetOrAdd(type, new UnsupportedMetadataTypeSymbol()); 298return (NamedTypeSymbol)this.SymbolMap.GetOrAdd(type, _retargetingModule._createRetargetingNamedType); 310private NamedTypeSymbol RetargetNoPiaLocalType(NamedTypeSymbol type) 312NamedTypeSymbol cached; 320NamedTypeSymbol result; 401private static NamedTypeSymbol RetargetNamedTypeDefinition(PENamedTypeSymbol type, PEModuleSymbol addedModule) 410return (NamedTypeSymbol)cached; 413NamedTypeSymbol? result; 415NamedTypeSymbol containingType = type.ContainingType; 423NamedTypeSymbol scope = RetargetNamedTypeDefinition((PENamedTypeSymbol)containingType, addedModule); 440private static NamedTypeSymbol PerformTypeRetargeting( 442NamedTypeSymbol type) 444NamedTypeSymbol? result; 449NamedTypeSymbol containingType = type.ContainingType; 450NamedTypeSymbol? result1; 458NamedTypeSymbol scope = PerformTypeRetargeting(ref destination, containingType); 483public NamedTypeSymbol Retarget(NamedTypeSymbol type, RetargetOptions options) 485NamedTypeSymbol originalDefinition = type.OriginalDefinition; 487NamedTypeSymbol newDefinition = RetargetNamedTypeDefinition(originalDefinition, options); 514NamedTypeSymbol genericType = type; 551NamedTypeSymbol constructedType; 662var namedType = (NamedTypeSymbol)symbol; 720NamedTypeSymbol oldModifierSymbol = ((CSharpCustomModifier)oldModifier).ModifierSymbol; 721NamedTypeSymbol newModifierSymbol = Retarget(oldModifierSymbol, RetargetOptions.RetargetPrimitiveTypesByName); // should be retargeted by name 834public ImmutableArray<NamedTypeSymbol> Retarget(ImmutableArray<NamedTypeSymbol> sequence) 891var containingType = method.ContainingType; 892var retargetedType = Retarget(containingType, RetargetOptions.RetargetPrimitiveTypesByName); 939var containingType = property.ContainingType; 940var retargetedType = Retarget(containingType, RetargetOptions.RetargetPrimitiveTypesByName); 955var containingType = @event.ContainingType; 956var retargetedType = Retarget(containingType, RetargetOptions.RetargetPrimitiveTypesByName); 964private MethodSymbol FindMethodInRetargetedType(MethodSymbol method, NamedTypeSymbol retargetedType, IEqualityComparer<MethodSymbol> retargetedMethodComparer) 971private readonly NamedTypeSymbol _retargetedType; 974private RetargetedTypeMethodFinder(RetargetingModuleSymbol retargetingModule, NamedTypeSymbol retargetedType, MethodSymbol toFind) : 981public static MethodSymbol Find(RetargetingSymbolTranslator translator, MethodSymbol method, NamedTypeSymbol retargetedType, IEqualityComparer<MethodSymbol> retargetedMethodComparer) 998NamedTypeSymbol retargetedType, 1055NamedTypeSymbol containingType = _toFind.ContainingType; 1056NamedTypeSymbol retargetedContainingType = _retargetedType; 1074private PropertySymbol FindPropertyInRetargetedType(PropertySymbol property, NamedTypeSymbol retargetedType, IEqualityComparer<PropertySymbol> retargetedPropertyComparer) 1110private EventSymbol FindEventInRetargetedType(EventSymbol @event, NamedTypeSymbol retargetedType) 1163NamedTypeSymbol oldAttributeType = oldAttributeData.AttributeClass; 1164NamedTypeSymbol newAttributeType; 1329public override Symbol VisitNamedType(NamedTypeSymbol symbol, RetargetOptions options)
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (2)
97internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 102internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\Source\CrefTypeParameterSymbol.cs (3)
202internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 204return ImmutableArray<NamedTypeSymbol>.Empty; 207internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\Source\ExplicitInterfaceHelpers.cs (8)
126var unsubstitutedInterfaceType = unsubstitutedPropertyImplemented.ContainingType; 128var explicitInterfaceType = map.SubstituteNamedType(unsubstitutedInterfaceType); 189var containingType = implementingMember.ContainingType; 213var explicitInterfaceNamedType = (NamedTypeSymbol)explicitInterfaceType; 217MultiDictionary<NamedTypeSymbol, NamedTypeSymbol>.ValueSet set = containingType.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics[explicitInterfaceNamedType]; 385NamedTypeSymbol explicitInterfaceType = implementedMember.ContainingType;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
117internal sealed override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments)
Symbols\Source\ImplicitNamedTypeSymbol.cs (11)
31protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 45protected override Location GetCorrespondingBaseListLocation(NamedTypeSymbol @base) 56internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics 66internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 71internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 73return ImmutableArray<NamedTypeSymbol>.Empty; 76internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 78return ImmutableArray<NamedTypeSymbol>.Empty; 106internal override NamedTypeSymbol ComImportCoClass 176internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 178internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => null;
Symbols\Source\IndexedTypeParameterSymbol.cs (3)
217internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 219return ImmutableArray<NamedTypeSymbol>.Empty; 222internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\Source\ParameterHelpers.cs (2)
1006var requiresLocationType = binder.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_RequiresLocationAttribute, diagnostics, syntax); 1017var modifierType = binder.GetWellKnownType(modifier, diagnostics, syntax);
Symbols\Source\SourceAssemblySymbol.cs (29)
21using CommonAssemblyWellKnownAttributeData = Microsoft.CodeAnalysis.CommonAssemblyWellKnownAttributeData<Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol>; 74private IDictionary<string, NamedTypeSymbol> _lazyForwardedTypesFromSource; 1066var topLevelTypesFromModules = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 1084NamedTypeSymbol x = topLevelTypesFromModules[i]; 1085NamedTypeSymbol y = topLevelTypesFromModules[i + 1]; 1121private class NameCollisionForAddedModulesTypeComparer : IComparer<NamedTypeSymbol> 1127public int Compare(NamedTypeSymbol x, NamedTypeSymbol y) 1225var attributeClass = attribute.AttributeClass; 1388HashSet<NamedTypeSymbol> forwardedTypes = null; 1396foreach (NamedTypeSymbol forwarded in peModuleSymbol.GetForwardedTypes()) 1408forwardedTypes = new HashSet<NamedTypeSymbol>(); 1708internal HashSet<NamedTypeSymbol> GetForwardedTypes() 1821var securityActionType = _compilation.GetWellKnownType(WellKnownType.System_Security_Permissions_SecurityAction); 1893var obj = GetSpecialType(SpecialType.System_Object); 2082if (((NamedTypeSymbol)member).MightContainExtensionMethods) 2252HashSet<NamedTypeSymbol> forwardedTypes = assemblyData.ForwardedTypes; 2255forwardedTypes = new HashSet<NamedTypeSymbol>() { (NamedTypeSymbol)forwardedType }; 2258else if (!forwardedTypes.Add((NamedTypeSymbol)forwardedType)) 2807internal override NamedTypeSymbol? TryLookupForwardedMetadataTypeWithCycleDetection(ref MetadataTypeName emittedName, ConsList<AssemblySymbol>? visitedAssemblies) 2827IDictionary<string, NamedTypeSymbol> forwardedTypesFromSource; 2829HashSet<NamedTypeSymbol> forwardedTypes = GetForwardedTypes(); 2833forwardedTypesFromSource = new Dictionary<string, NamedTypeSymbol>(StringOrdinalComparer.Instance); 2835foreach (NamedTypeSymbol forwardedType in forwardedTypes) 2837NamedTypeSymbol originalDefinition = forwardedType.OriginalDefinition; 2849forwardedTypesFromSource = SpecializedCollections.EmptyDictionary<string, NamedTypeSymbol>(); 2855NamedTypeSymbol? result; 2937internal override IEnumerable<NamedTypeSymbol> GetAllTopLevelForwardedTypes()
Symbols\Source\SourceComplexParameterSymbol.cs (7)
622internal override void EarlyDecodeWellKnownAttributeType(NamedTypeSymbol attributeType, AttributeSyntax attributeSyntax) 645internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 709private (CSharpAttributeData?, BoundAttribute?) EarlyDecodeAttributeForDefaultParameterValue(AttributeDescription description, ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 987((NamedTypeSymbol)arg.TypeInternal).EnumUnderlyingType.SpecialType : 1253if (Type is not NamedTypeSymbol { IsInterpolatedStringHandlerType: true } handlerType) 1643MethodSymbol? collectionBuilderMethod = binder.GetAndValidateCollectionBuilderMethod(syntax, (NamedTypeSymbol)Type, diagnostics, elementType: out _); 1649if (ContainingSymbol.ContainingSymbol is NamedTypeSymbol) // No need to check for lambdas or local function
Symbols\Source\SourceConstructorSymbol.cs (2)
81NamedTypeSymbol containingType, 123NamedTypeSymbol containingType, ConstructorDeclarationSyntax syntax, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics,
Symbols\Source\SourceConstructorSymbolBase.cs (1)
232internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments)
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
282var modifierType = binder.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, syntax.ReturnType);
Symbols\Source\SourceDestructorSymbol.cs (2)
64private static (DeclarationModifiers, Flags) MakeModifiersAndFlags(NamedTypeSymbol containingType, DestructorDeclarationSyntax syntax, bool isNullableAnalysisEnabled, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors) 129private static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxTokenList modifiers, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors)
Symbols\Source\SourceEventSymbol.cs (3)
101public override NamedTypeSymbol ContainingType 253internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 701foreach (NamedTypeSymbol @interface in this.containingType.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics.Keys)
Symbols\Source\SourceFieldSymbol.cs (1)
106public override NamedTypeSymbol ContainingType
Symbols\Source\SourceFixedFieldSymbol.cs (3)
45var systemType = compilation.GetWellKnownType(WellKnownType.System_Type); 141internal override NamedTypeSymbol FixedImplementationType(PEModuleBuilder emitModule) 236internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics
Symbols\Source\SourceMemberContainerSymbol.cs (41)
209private static readonly Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>> s_emptyTypeMembers = 210new Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>>(EmptyReadOnlyMemoryOfCharComparer.Instance); 212private Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>>? _lazyTypeMembers; 262var containingType = this.ContainingType; 305if (((NamedTypeSymbol)containingSymbol).IsInterface) 581var discarded = this.EnumUnderlyingType; 755public sealed override NamedTypeSymbol? ContainingType 759return _containingSymbol as NamedTypeSymbol; 1274internal override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 1279public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 1284public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 1286ImmutableArray<NamedTypeSymbol> members; 1292return ImmutableArray<NamedTypeSymbol>.Empty; 1295public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 1300private Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>> GetTypeMembersDictionary() 1318private Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>> MakeTypeMembers(BindingDiagnosticBag diagnostics) 1320var symbols = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 1681if (member is NamedTypeSymbol type) 1825var baseType = BaseTypeNoUseSiteDiagnostics; 1894bool hasBaseTypeOrInterface(Func<NamedTypeSymbol, bool> predicate) 2406BaseTypeAnalysis.StructDependsOn((NamedTypeSymbol)type, this) && 2693var instanceMap = new Dictionary<NamedTypeSymbol, NamedTypeSymbol>(ReferenceEqualityComparer.Instance); 2714var type = (NamedTypeSymbol)f.Type; 2725private static bool InfiniteFlatteningGraph(SourceMemberContainerTypeSymbol top, NamedTypeSymbol t, Dictionary<NamedTypeSymbol, NamedTypeSymbol> instanceMap) 2728var tOriginal = t.OriginalDefinition; 2729if (instanceMap.TryGetValue(tOriginal, out var oldInstance)) 2743var type = (NamedTypeSymbol)f.Type; 2870Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>> typesByName) 2872foreach ((ReadOnlyMemory<char> name, ImmutableArray<NamedTypeSymbol> types) in typesByName) 3465ImmutableArray<Symbol> types = GetTypeMembers(name).Cast<NamedTypeSymbol, Symbol>(); 4509var currentBaseType = this.BaseTypeNoUseSiteDiagnostics; 5297var baseType = BaseTypeNoUseSiteDiagnostics; 5302foreach (var @interface in GetInterfacesToEmit()) 5335NamedTypeSymbol baseType = this.BaseTypeNoUseSiteDiagnostics; 5413foreach (var type in this.GetTypeMembers()) 5433public sealed override NamedTypeSymbol ConstructedFrom
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (31)
90NamedTypeSymbol baseType = this.BaseTypeNoUseSiteDiagnostics; 121MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> interfacesAndTheirBases = this.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics; 123foreach (var @interface in this.AllInterfacesNoUseSiteDiagnostics) 342protected abstract Location GetCorrespondingBaseListLocation(NamedTypeSymbol @base); 345private Location GetImplementsLocationOrFallback(NamedTypeSymbol implementedInterface) 350internal Location? GetImplementsLocation(NamedTypeSymbol implementedInterface) 359NamedTypeSymbol directInterface = null; 360foreach (var iface in this.InterfacesNoUseSiteDiagnostics()) 442private HasBaseTypeDeclaringInterfaceResult HasBaseClassDeclaringInterface(NamedTypeSymbol @interface) 446for (NamedTypeSymbol currType = this.BaseTypeNoUseSiteDiagnostics; (object)currType != null; currType = currType.BaseTypeNoUseSiteDiagnostics) 457private static bool DeclaresBaseInterface(NamedTypeSymbol currType, NamedTypeSymbol @interface, ref HasBaseTypeDeclaringInterfaceResult result) 459MultiDictionary<NamedTypeSymbol, NamedTypeSymbol>.ValueSet set = currType.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics[@interface]; 477private void HasBaseInterfaceDeclaringInterface(NamedTypeSymbol baseInterface, NamedTypeSymbol @interface, ref HasBaseTypeDeclaringInterfaceResult matchResult) 485foreach (var interfaceType in this.AllInterfacesNoUseSiteDiagnostics) 698NamedTypeSymbol currType = this.BaseTypeNoUseSiteDiagnostics; 834NamedTypeSymbol overridingType = overridingMember.ContainingType; 873var overridingType = overridingMember.ContainingType; 1047var overridingType = overridingProperty.ContainingType; 1750NamedTypeSymbol[] interfaces = this.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics.Keys.ToArray(); 1756NamedTypeSymbol interface1 = interfaces[i1]; 1757NamedTypeSymbol interface2 = interfaces[i2]; 1767var temp = interface1; 1894private static bool IsPossibleImplementationUnderRuntimeRules(MethodSymbol implementingMethod, NamedTypeSymbol @interface) 1896NamedTypeSymbol type = implementingMethod.ContainingType; 1902NamedTypeSymbol baseType = type.BaseTypeNoUseSiteDiagnostics; 1918private static bool IsOverrideOfPossibleImplementationUnderRuntimeRules(MethodSymbol implementingMethod, NamedTypeSymbol @interface) 1933internal sealed override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit()
Symbols\Source\SourceMemberFieldSymbol.cs (3)
165internal static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxToken firstIdentifier, SyntaxTokenList modifiers, bool isRefField, BindingDiagnosticBag diagnostics, out bool modifierErrors) 313internal override NamedTypeSymbol FixedImplementationType(PEModuleBuilder emitModule) 468NamedTypeSymbol tokenTableType = this.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_EventRegistrationTokenTable_T);
Symbols\Source\SourceMemberMethodSymbol.cs (4)
295private readonly NamedTypeSymbol _containingType; 321NamedTypeSymbol containingType, 500public override NamedTypeSymbol ContainingType 1042if (moduleBuilder.CompilationState.TryGetStateMachineType(this, out NamedTypeSymbol stateMachineType))
Symbols\Source\SourceMethodSymbolWithAttributes.cs (7)
332internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 1439var systemType = @this.DeclaringCompilation.GetWellKnownType(WellKnownType.System_Type); 1447static (m, systemType) => m is FieldSymbol { Type: ArrayTypeSymbol { ElementType: NamedTypeSymbol elementType } } && elementType.Equals(systemType, TypeCompareKind.ConsiderEverything), 1475if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface }) 1561for (NamedTypeSymbol curr = this.ContainingType; (object)curr != null; curr = curr.ContainingType) 1583var iAsyncEnumerableType = DeclaringCompilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T); 1587var cancellationTokenType = DeclaringCompilation.GetWellKnownType(WellKnownType.System_Threading_CancellationToken);
Symbols\Source\SourceModuleSymbol.cs (3)
180if (((NamedTypeSymbol)s).IsExplicitDefinitionOfNoPiaLocalType) 657CommonAssemblyWellKnownAttributeData<NamedTypeSymbol> decodedData = ((SourceAssemblySymbol)this.ContainingAssembly).GetSourceDecodedWellKnownAttributeData(); 666CommonAssemblyWellKnownAttributeData<NamedTypeSymbol> decodedData = ((SourceAssemblySymbol)this.ContainingAssembly).GetSourceDecodedWellKnownAttributeData();
Symbols\Source\SourceNamedTypeSymbol.cs (15)
36protected override Location GetCorrespondingBaseListLocation(NamedTypeSymbol @base) 102protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 897internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 1232return builderType is NamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct, IsGenericType: false }; 1338var coClassType = argument.ValueInternal as NamedTypeSymbol; 1355internal override NamedTypeSymbol ComImportCoClass 1587var baseType = this.BaseTypeNoUseSiteDiagnostics; 1755internal override NamedTypeSymbol AsNativeInteger() 1766internal override NamedTypeSymbol NativeIntegerUnderlyingType => null; 1840NamedTypeSymbol? index = null; 1841NamedTypeSymbol? range = null; 1863NamedTypeSymbol? span = null; 1864NamedTypeSymbol? readOnlySpan = null; 1879Conversions.HasIdentityConversion(((NamedTypeSymbol)returnTypeOriginalDefinition).Construct(ImmutableArray.Create(elementType)), returnType))
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (53)
24private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> _lazyDeclaredBases; 26private NamedTypeSymbol _lazyBaseType = ErrorTypeSymbol.UnknownResultType; 27private ImmutableArray<NamedTypeSymbol> _lazyInterfaces; 35internal sealed override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics 46var tmp = ContainingType.BaseTypeNoUseSiteDiagnostics; 50var acyclicBase = this.MakeAcyclicBaseType(diagnostics); 66internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 72return ImmutableArray<NamedTypeSymbol>.Empty; 77if (ImmutableInterlocked.InterlockedCompareExchange(ref _lazyInterfaces, acyclicInterfaces, default(ImmutableArray<NamedTypeSymbol>)).IsDefault) 89var localBase = this.BaseTypeNoUseSiteDiagnostics; 168MultiDictionary<NamedTypeSymbol, NamedTypeSymbol>.ValueSet set = pair.Value; 177NamedTypeSymbol other = pair.Key; 212private SourceLocation FindBaseRefSyntax(NamedTypeSymbol baseSym) 255internal Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> GetDeclaredBases(ConsList<TypeSymbol> basesBeingResolved) 270internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 275internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 280private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> MakeDeclaredBases(ConsList<TypeSymbol> basesBeingResolved, BindingDiagnosticBag diagnostics) 285return new Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>>(null, ImmutableArray<NamedTypeSymbol>.Empty); 291var baseInterfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 293NamedTypeSymbol baseType = null; 296var interfaceLocations = SpecializedSymbolCollections.GetPooledSymbolDictionaryInstance<NamedTypeSymbol, SourceLocation>(); 300Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> one = MakeOneDeclaredBases(newBasesBeingResolved, decl, diagnostics); 303var partBase = one.Item1; 358foreach (var t in partInterfaces) 372var type = DeclaringCompilation.GetWellKnownType(WellKnownType.System_IEquatable_T).Construct(this); 423return new Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>>(baseType, baseInterfacesRO); 438private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> MakeOneDeclaredBases(ConsList<TypeSymbol> newBasesBeingResolved, SingleTypeDeclaration decl, BindingDiagnosticBag diagnostics) 446NamedTypeSymbol localBase = null; 447var localInterfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 526localBase = (NamedTypeSymbol)baseType; 580localInterfaces.Add((NamedTypeSymbol)baseType); 588localBase = (NamedTypeSymbol)baseType; 606localInterfaces.Add((NamedTypeSymbol)baseType); 628return new Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>>(localBase, localInterfaces.ToImmutableAndFree()); 658private ImmutableArray<NamedTypeSymbol> MakeAcyclicInterfaces(ConsList<TypeSymbol> basesBeingResolved, BindingDiagnosticBag diagnostics) 665return ImmutableArray<NamedTypeSymbol>.Empty; 671ArrayBuilder<NamedTypeSymbol> result = isInterface ? ArrayBuilder<NamedTypeSymbol>.GetInstance() : null; 672foreach (var t in declaredInterfaces) 694foreach (var @interface in t.AllInterfacesNoUseSiteDiagnostics) 709private NamedTypeSymbol MakeAcyclicBaseType(BindingDiagnosticBag diagnostics) 713NamedTypeSymbol declaredBase; 763NamedTypeSymbol current = declaredBase;
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (5)
18private NamedTypeSymbol _lazyEnumUnderlyingType = ErrorTypeSymbol.UnknownResultType; 24public override NamedTypeSymbol EnumUnderlyingType 44private NamedTypeSymbol GetEnumUnderlyingType(BindingDiagnosticBag diagnostics) 72return (NamedTypeSymbol)type; 76NamedTypeSymbol defaultUnderlyingType = compilation.GetSpecialType(SpecialType.System_Int32);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (2)
797var importedType = (NamedTypeSymbol)imported;
Symbols\Source\SourceNamespaceSymbol.cs (13)
32private Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>> _nameToTypeMembersMap; 34private ImmutableArray<NamedTypeSymbol> _lazyTypeMembersUnordered; 179internal override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 190public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 195public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 197ImmutableArray<NamedTypeSymbol> members; 200: ImmutableArray<NamedTypeSymbol>.Empty; 203public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 248private Dictionary<ReadOnlyMemory<char>, ImmutableArray<NamedTypeSymbol>> GetNameToTypeMembersMap() 256ImmutableArrayExtensions.GetTypesFromMemberMap<ReadOnlyMemory<char>, NamespaceOrTypeSymbol, NamedTypeSymbol>( 283ImmutableArrayExtensions.CreateNameToMembersMap<ReadOnlyMemory<char>, NamespaceOrTypeSymbol, NamedTypeSymbol, NamespaceSymbol>(builder, result); 440var type = member as NamedTypeSymbol;
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
24protected SourceOrdinaryMethodOrUserDefinedOperatorSymbol(NamedTypeSymbol containingType, SyntaxReference syntaxReferenceOpt, Location location, bool isIterator, (DeclarationModifiers declarationModifiers, Flags flags) modifiersAndFlags) 120var modifierType = Binder.GetWellKnownType(DeclaringCompilation, WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, ReturnTypeLocation);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (7)
23NamedTypeSymbol containingType, 48NamedTypeSymbol containingType, 90NamedTypeSymbol containingType, Location location, MethodDeclarationSyntax syntax, MethodKind methodKind, 424private static DeclarationModifiers MakeDeclarationModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, Location location, DeclarationModifiers allowedModifiers, BindingDiagnosticBag diagnostics) 687private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 918NamedTypeSymbol containingType, 975NamedTypeSymbol containingType,
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
29NamedTypeSymbol containingType,
Symbols\Source\SourcePropertyAccessorSymbol.cs (9)
29NamedTypeSymbol containingType, 66NamedTypeSymbol containingType, 87NamedTypeSymbol containingType, 113NamedTypeSymbol containingType, 140NamedTypeSymbol containingType, 174NamedTypeSymbol containingType, 223NamedTypeSymbol containingType, SourcePropertySymbolBase property, DeclarationModifiers propertyModifiers, Location location, 391var isInitOnlyType = Binder.GetWellKnownType(this.DeclaringCompilation, 492private static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxTokenList modifiers, bool isExplicitInterfaceImplementation,
Symbols\Source\SourcePropertySymbol.cs (1)
359NamedTypeSymbol containingType,
Symbols\Source\SourcePropertySymbolBase.cs (3)
270var modifierType = Binder.GetWellKnownType(DeclaringCompilation, WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, TypeLocation); 511public override NamedTypeSymbol ContainingType 1418internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments)
Symbols\Source\SourceTypeParameterSymbol.cs (4)
98internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 101return (bounds != null) ? bounds.Interfaces : ImmutableArray<NamedTypeSymbol>.Empty; 104internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 344private NamedTypeSymbol GetDefaultBaseType()
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
701public static bool IsSelfConstrainedTypeParameter(TypeSymbol type, NamedTypeSymbol containingType)
Symbols\Source\SynthesizedAttributeData.cs (2)
47public override NamedTypeSymbol AttributeClass => _wellKnownMember.ContainingType; 77public override NamedTypeSymbol AttributeClass => _original.AttributeClass;
Symbols\SubstitutedFieldSymbol.cs (3)
46public override NamedTypeSymbol ContainingType 97internal override NamedTypeSymbol FixedImplementationType(PEModuleBuilder emitModule) 103return (NamedTypeSymbol)_containingType.TypeSubstitution.SubstituteType(OriginalDefinition.FixedImplementationType(emitModule)).Type;
Symbols\SubstitutedMethodSymbol.cs (3)
40internal SubstitutedMethodSymbol(NamedTypeSymbol containingSymbol, MethodSymbol originalDefinition) 198public override NamedTypeSymbol ContainingType 202return _containingSymbol is NamedTypeSymbol nt ? nt : _containingSymbol.ContainingType;
Symbols\SubstitutedNamedTypeSymbol.cs (25)
27private static readonly Func<Symbol, NamedTypeSymbol, Symbol> s_symbolAsMemberFunc = SymbolExtensions.SymbolAsMember; 43private NamedTypeSymbol _lazyBaseType = ErrorTypeSymbol.UnknownResultType; 53protected SubstitutedNamedTypeSymbol(Symbol newContainer, TypeMap map, NamedTypeSymbol originalDefinition, NamedTypeSymbol constructedFrom = null, bool unbound = false, TupleExtraData tupleData = null) 127public override NamedTypeSymbol ContainingType 131return _newContainer as NamedTypeSymbol; 140public sealed override NamedTypeSymbol OriginalDefinition 145internal sealed override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) 150internal sealed override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) 152return _unbound ? ImmutableArray<NamedTypeSymbol>.Empty : Map.SubstituteNamedTypes(OriginalDefinition.GetDeclaredInterfaces(basesBeingResolved)); 155internal sealed override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics 166var baseType = Map.SubstituteNamedType(OriginalDefinition.BaseTypeNoUseSiteDiagnostics); 175internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) 177return _unbound ? ImmutableArray<NamedTypeSymbol>.Empty : Map.SubstituteNamedTypes(OriginalDefinition.InterfacesNoUseSiteDiagnostics(basesBeingResolved)); 180internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() 210internal sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembersUnordered() 215public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 220public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 225public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 248builder.Add(((NamedTypeSymbol)t).AsMember(this)); 298builder.Add(((NamedTypeSymbol)t).AsMember(this)); 408public sealed override NamedTypeSymbol EnumUnderlyingType 436internal sealed override NamedTypeSymbol ComImportCoClass 476internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 478internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => null;
Symbols\SubstitutedPropertySymbol.cs (1)
47public override NamedTypeSymbol ContainingType
Symbols\SubstitutedTypeParameterSymbol.cs (2)
170internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 175internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\Symbol.cs (5)
114public virtual NamedTypeSymbol ContainingType 120NamedTypeSymbol containerAsType = container as NamedTypeSymbol; 651if (((NamedTypeSymbol)this).IsSubmissionClass) 1273NamedTypeSymbol modifierType = ((CSharpCustomModifier)modifier).ModifierSymbol;
Symbols\Symbol_Attributes.cs (18)
67var namedType = (NamedTypeSymbol)this; 122internal virtual void EarlyDecodeWellKnownAttributeType(NamedTypeSymbol attributeType, AttributeSyntax attributeSyntax) 142internal virtual (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 148ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments, 333var attributeTypesBuilder = new NamedTypeSymbol[totalAttributesCount]; 349ImmutableArray<NamedTypeSymbol> boundAttributeTypes = attributeTypesBuilder.AsImmutableOrNull(); 551var boundTypeSymbol = (NamedTypeSymbol)boundType.Type; 767ImmutableArray<NamedTypeSymbol> boundAttributeTypes, 780var arguments = new EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation>(); 785NamedTypeSymbol boundAttributeType = boundAttributeTypes[i]; 814private void EarlyDecodeWellKnownAttributeTypes(ImmutableArray<NamedTypeSymbol> attributeTypes, ImmutableArray<AttributeSyntax> attributeSyntaxList) 821var attributeType = attributeTypes[i]; 851HashSet<NamedTypeSymbol> uniqueAttributeTypes = new HashSet<NamedTypeSymbol>(); 892HashSet<NamedTypeSymbol> uniqueAttributeTypes) 896NamedTypeSymbol attributeType = attribute.AttributeClass;
Symbols\SymbolExtensions.cs (20)
33public static NamedTypeSymbol ConstructIfGeneric(this NamedTypeSymbol type, ImmutableArray<TypeWithAnnotations> typeArguments) 41return symbol is NamedTypeSymbol && (object?)symbol.ContainingType != null; 47public static bool IsAccessibleViaInheritance(this NamedTypeSymbol superType, NamedTypeSymbol subType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 60NamedTypeSymbol originalSuperType = superType.OriginalDefinition; 61for (NamedTypeSymbol? current = subType; 73foreach (NamedTypeSymbol current in subType.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 162NamedTypeSymbol type; 185type = (NamedTypeSymbol)symbol; 205return ((NamedTypeSymbol)symbol).ConstructedFrom; 316var upperLevelType = symbol.Kind == SymbolKind.NamedType ? (NamedTypeSymbol)symbol : symbol.ContainingType; 350return ((NamedTypeSymbol)symbol).Arity; 426internal static NamedTypeSymbol? EnsureCSharpSymbolOrNull(this INamedTypeSymbol? symbol, string paramName) 428return (NamedTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 581internal static INamedTypeSymbol? GetPublicSymbol(this NamedTypeSymbol? symbol) 719internal static ImmutableArray<INamedTypeSymbol> GetPublicSymbols(this ImmutableArray<NamedTypeSymbol> symbols) 784internal static NamedTypeSymbol? GetSymbol(this INamedTypeSymbol? symbol) 786return symbol.GetSymbol<NamedTypeSymbol>();
Symbols\SymbolVisitor.cs (1)
80public virtual void VisitNamedType(NamedTypeSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
80public virtual TResult VisitNamedType(NamedTypeSymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
88/// Called when visiting a <see cref="NamedTypeSymbol" />; Override this with specific 94public virtual TResult VisitNamedType(NamedTypeSymbol symbol, TArgument argument)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (16)
19private readonly ImmutableArray<NamedTypeSymbol> _interfaces; 124public override NamedTypeSymbol ConstructedFrom => this; 190internal override NamedTypeSymbol? NativeIntegerUnderlyingType => null; 192internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 204public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 206public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => ImmutableArray<NamedTypeSymbol>.Empty; 208public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 210protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) => throw ExceptionUtilities.Unreachable(); 212internal override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 218internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => BaseTypeNoUseSiteDiagnostics; 220internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => _interfaces; 228internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => _interfaces; 259internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => _interfaces;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListMethod.cs (1)
13internal SynthesizedReadOnlyListMethod(NamedTypeSymbol containingType, MethodSymbol interfaceMethod, GenerateMethodBodyDelegate generateMethodBody) :
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (2)
12private readonly NamedTypeSymbol _containingType; 16NamedTypeSymbol containingType,
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (3)
63internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 65internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (22)
127internal static NamedTypeSymbol Create(SourceModuleSymbol containingModule, string name, SynthesizedReadOnlyListKind kind) 257private readonly ImmutableArray<NamedTypeSymbol> _interfaces; 260private readonly NamedTypeSymbol? _enumeratorType; 287var iCollection = compilation.GetWellKnownType(WellKnownType.System_Collections_ICollection); 288var iList = compilation.GetWellKnownType(WellKnownType.System_Collections_IList); 478var enumeratorType = containingType._enumeratorType; 747var equalityComparerType = equalityComparer_Equals.ContainingType; 748var constructedEqualityComparer = equalityComparerType.Construct(fieldType); 775return symbol.SymbolAsMember((NamedTypeSymbol)_field.Type); 801public override NamedTypeSymbol ConstructedFrom => this; 867internal override NamedTypeSymbol? NativeIntegerUnderlyingType => null; 869internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 881public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 884: ImmutableArray<NamedTypeSymbol>.Empty; 886public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 889public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 892protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) => throw ExceptionUtilities.Unreachable(); 894internal override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 900internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => BaseTypeNoUseSiteDiagnostics; 902internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => _interfaces; 910internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => _interfaces; 947internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => _interfaces;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
140internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments)
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
65public override NamedTypeSymbol ContainingType
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (3)
83private static MethodSymbol? VirtualCloneInBase(NamedTypeSymbol containingType) 85NamedTypeSymbol baseType = containingType.BaseTypeNoUseSiteDiagnostics; 143if (containingType.IsObjectType() || containingType is not NamedTypeSymbol containingNamedType)
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (3)
89internal static MethodSymbol? FindCopyConstructor(NamedTypeSymbol containingType, NamedTypeSymbol within, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 145NamedTypeSymbol containingType = member.ContainingType;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
134NamedTypeSymbol containingType,
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (2)
265NamedTypeSymbol baseType = overriding.ContainingType.BaseTypeNoUseSiteDiagnostics; 294private static bool IsReadOnly(NamedTypeSymbol containingType, IEnumerable<Symbol> userDefinedMembers)
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (1)
56var stringBuilder = F.WellKnownType(WellKnownType.System_Text_StringBuilder);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
151public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedContainer.cs (16)
77protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 92public override NamedTypeSymbol ConstructedFrom => this; 144public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 146public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 148public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => ImmutableArray<NamedTypeSymbol>.Empty; 158internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved) => ImmutableArray<NamedTypeSymbol>.Empty; 160internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => CalculateInterfacesToEmit(); 162internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(this.TypeKind == TypeKind.Struct ? SpecialType.System_ValueType : SpecialType.System_Object); 164internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => BaseTypeNoUseSiteDiagnostics; 166internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => InterfacesNoUseSiteDiagnostics(basesBeingResolved); 208internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 210internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => null;
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (3)
17public SynthesizedDelegateConstructor(NamedTypeSymbol containingType, TypeSymbol objectType, TypeSymbol intPtrType) 53private readonly NamedTypeSymbol _containingType; 56NamedTypeSymbol containingType,
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (22)
31private readonly NamedTypeSymbol _baseType; 39NamedTypeSymbol baseType) 62public override NamedTypeSymbol ConstructedFrom => this; 135internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => _baseType; 139protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) => throw ExceptionUtilities.Unreachable(); 145public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 147public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 149public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => ImmutableArray<NamedTypeSymbol>.Empty; 155internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => _baseType; 157internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => ImmutableArray<NamedTypeSymbol>.Empty; 165internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => ImmutableArray<NamedTypeSymbol>.Empty; 169internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty; 196internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 198internal sealed override NamedTypeSymbol NativeIntegerUnderlyingType => null; 238NamedTypeSymbol baseType) 252NamedTypeSymbol containingType,
Symbols\Synthesized\SynthesizedEmbeddedLifetimeAnnotationAttributeSymbol.cs (1)
18NamedTypeSymbol systemAttributeType)
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (1)
26NamedTypeSymbol systemAttributeType,
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (2)
28NamedTypeSymbol systemAttributeType, 117NamedTypeSymbol containingType,
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (1)
25NamedTypeSymbol systemAttributeType,
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (1)
25NamedTypeSymbol systemAttributeType,
Symbols\Synthesized\SynthesizedEmbeddedRefSafetyRulesAttributeSymbol.cs (1)
23NamedTypeSymbol systemAttributeType,
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (8)
25private readonly NamedTypeSymbol _containingType; 29var containingType = initializerMethod.ContainingType; 33var systemObject = Binder.GetSpecialType(compilation, SpecialType.System_Object, DummySyntax(), diagnostics); 43var systemVoid = Binder.GetSpecialType(compilation, SpecialType.System_Void, DummySyntax(), diagnostics); 48private SynthesizedEntryPointSymbol(NamedTypeSymbol containingType) 341internal AsyncForwardEntryPoint(CSharpCompilation compilation, NamedTypeSymbol containingType, MethodSymbol userMain) : 446internal ScriptEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType) : 535internal SubmissionEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType, TypeSymbol submissionArrayType) :
Symbols\Synthesized\SynthesizedExplicitImplementationForwardingMethod.cs (1)
27public SynthesizedExplicitImplementationForwardingMethod(MethodSymbol interfaceMethod, MethodSymbol implementingMethod, NamedTypeSymbol implementingType)
Symbols\Synthesized\SynthesizedFieldSymbol.cs (1)
24NamedTypeSymbol containingType,
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (3)
20private readonly NamedTypeSymbol _containingType; 25NamedTypeSymbol containingType, 150public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
82public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
14internal SynthesizedHotReloadExceptionConstructorSymbol(NamedTypeSymbol containingType, TypeSymbol stringType, TypeSymbol intType) :
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (14)
25private readonly NamedTypeSymbol _baseType; 33NamedTypeSymbol exceptionType, 70public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => []; 71public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => []; 72public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => []; 88public override NamedTypeSymbol ConstructedFrom => this; 118internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => _baseType; 120protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) => throw ExceptionUtilities.Unreachable(); 123internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => _baseType; 124internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => []; 127internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => []; 129internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => []; 133internal sealed override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 134internal sealed override NamedTypeSymbol? NativeIntegerUnderlyingType => null;
Symbols\Synthesized\SynthesizedImplementationMethod.cs (3)
18private readonly NamedTypeSymbol _implementingType; 30NamedTypeSymbol implementingType, 120public sealed override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedInlineArrayAsReadOnlySpanMethod.cs (2)
12internal SynthesizedInlineArrayAsReadOnlySpanMethod(SynthesizedPrivateImplementationDetailsType privateImplType, string synthesizedMethodName, NamedTypeSymbol spanType, NamedTypeSymbol intType)
Symbols\Synthesized\SynthesizedInlineArrayAsSpanMethod.cs (2)
12internal SynthesizedInlineArrayAsSpanMethod(SynthesizedPrivateImplementationDetailsType privateImplType, string synthesizedMethodName, NamedTypeSymbol spanType, NamedTypeSymbol intType)
Symbols\Synthesized\SynthesizedInlineArrayElementRefMethod.cs (1)
12internal SynthesizedInlineArrayElementRefMethod(SynthesizedPrivateImplementationDetailsType privateImplType, string synthesizedMethodName, NamedTypeSymbol intType)
Symbols\Synthesized\SynthesizedInlineArrayElementRefReadOnlyMethod.cs (1)
12internal SynthesizedInlineArrayElementRefReadOnlyMethod(SynthesizedPrivateImplementationDetailsType privateImplType, string synthesizedMethodName, NamedTypeSymbol intType)
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (21)
49public override NamedTypeSymbol ConstructedFrom => this; 121internal override NamedTypeSymbol? NativeIntegerUnderlyingType => null; 123internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(SpecialType.System_ValueType); 135public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 137public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => ImmutableArray<NamedTypeSymbol>.Empty; 139public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 141protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) => throw ExceptionUtilities.Unreachable(); 143internal override NamedTypeSymbol AsNativeInteger() => throw ExceptionUtilities.Unreachable(); 149internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => BaseTypeNoUseSiteDiagnostics; 151internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => ImmutableArray<NamedTypeSymbol>.Empty; 159internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => ImmutableArray<NamedTypeSymbol>.Empty; 184internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty; 255internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 257internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (4)
18private readonly NamedTypeSymbol _containingType; 20internal SynthesizedInstanceConstructor(NamedTypeSymbol containingType) 60public sealed override NamedTypeSymbol ContainingType 198NamedTypeSymbol containingType = this.ContainingType;
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
266var taskT = compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T);
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
320public override NamedTypeSymbol ContainingType 324return _containingType as NamedTypeSymbol;
Symbols\Synthesized\SynthesizedLambdaCacheFieldSymbol.cs (1)
19public SynthesizedLambdaCacheFieldSymbol(NamedTypeSymbol containingType, TypeSymbol type, string name, MethodSymbol topLevelMethod, bool isReadOnly, bool isStatic)
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (20)
22private readonly NamedTypeSymbol _objectType; 24public SynthesizedPrivateImplementationDetailsType(PrivateImplementationDetails privateImplementationDetails, NamespaceSymbol globalNamespace, NamedTypeSymbol objectType) 42public override NamedTypeSymbol ConstructedFrom => this; 104internal override NamedTypeSymbol? NativeIntegerUnderlyingType => null; 106internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => _objectType; 118public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() => ImmutableArray<NamedTypeSymbol>.Empty; 120public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) => ImmutableArray<NamedTypeSymbol>.Empty; 122public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) => ImmutableArray<NamedTypeSymbol>.Empty; 124protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData) 129internal override NamedTypeSymbol AsNativeInteger() 141internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved) => _objectType; 143internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved) => ImmutableArray<NamedTypeSymbol>.Empty; 157internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit() => ImmutableArray<NamedTypeSymbol>.Empty; 182internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (3)
14private readonly NamedTypeSymbol _containingType; 17internal SynthesizedStaticConstructor(NamedTypeSymbol containingType) 30public override NamedTypeSymbol ContainingType
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (1)
16internal SynthesizedSubmissionConstructor(NamedTypeSymbol containingType, BindingDiagnosticBag diagnostics)
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
23(ContainingSymbol is NamedTypeSymbol ? TypeParameterKind.Type :
Symbols\SynthesizedNamespaceSymbol.cs (6)
67public override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 68=> ImmutableArray<NamedTypeSymbol>.Empty; 70public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 71=> ImmutableArray<NamedTypeSymbol>.Empty; 73public override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 74=> ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (2)
115internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 120internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress)
Symbols\Tuples\TupleErrorFieldSymbol.cs (2)
39NamedTypeSymbol container, 193internal override FieldSymbol AsMember(NamedTypeSymbol newOwner)
Symbols\Tuples\TupleFieldSymbol.cs (16)
28protected readonly NamedTypeSymbol _containingTuple; 38NamedTypeSymbol container, 108NamedTypeSymbol originalContainer = ContainingType.OriginalDefinition; 209internal override FieldSymbol AsMember(NamedTypeSymbol newOwner) 213NamedTypeSymbol newUnderlyingOwner = GetNewUnderlyingOwner(newOwner); 217protected NamedTypeSymbol GetNewUnderlyingOwner(NamedTypeSymbol newOwner) 220NamedTypeSymbol newUnderlyingOwner = newOwner; 221while (currentIndex >= NamedTypeSymbol.ValueTupleRestIndex) 223newUnderlyingOwner = (NamedTypeSymbol)newUnderlyingOwner.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestIndex].Type; 224currentIndex -= NamedTypeSymbol.ValueTupleRestIndex; 255NamedTypeSymbol container, 272Debug.Assert((correspondingDefaultFieldOpt is null) == (NamedTypeSymbol.TupleMemberName(tupleElementIndex + 1) == name)); 330internal override FieldSymbol AsMember(NamedTypeSymbol newOwner) 335NamedTypeSymbol newUnderlyingOwner = GetNewUnderlyingOwner(newOwner);
Symbols\Tuples\TupleTypeSymbol.cs (54)
30internal static NamedTypeSymbol CreateTuple( 53NamedTypeSymbol underlyingType = getTupleUnderlyingType(elementTypesWithAnnotations, syntax, compilation, diagnostics); 62var constructedType = CreateTuple(underlyingType, elementNames, errorPositions, elementLocations, locations); 74static NamedTypeSymbol getTupleUnderlyingType(ImmutableArray<TypeWithAnnotations> elementTypes, CSharpSyntaxNode? syntax, CSharpCompilation compilation, BindingDiagnosticBag? diagnostics) 80NamedTypeSymbol firstTupleType = compilation.GetWellKnownType(GetTupleType(remainder)); 86NamedTypeSymbol? chainedTupleType = null; 100public static NamedTypeSymbol CreateTuple( 101NamedTypeSymbol tupleCompatibleType, 111internal NamedTypeSymbol WithTupleDataFrom(NamedTypeSymbol original) 121internal NamedTypeSymbol? TupleUnderlyingType 127internal NamedTypeSymbol WithElementTypes(ImmutableArray<TypeWithAnnotations> newElementTypes) 132NamedTypeSymbol firstTupleType; 133NamedTypeSymbol? chainedTupleType; 134if (Arity < NamedTypeSymbol.ValueTupleRestPosition) 142var underlyingType = this; 145underlyingType = ((NamedTypeSymbol)underlyingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestIndex].Type); 147while (underlyingType.Arity >= NamedTypeSymbol.ValueTupleRestPosition); 161internal NamedTypeSymbol WithElementNames(ImmutableArray<string?> newElementNames, 171private NamedTypeSymbol WithTupleData(TupleExtraData newData) 196protected abstract NamedTypeSymbol WithTupleDataCore(TupleExtraData newData); 204internal static void GetUnderlyingTypeChain(NamedTypeSymbol underlyingTupleType, ArrayBuilder<NamedTypeSymbol> underlyingTupleTypeChain) 206NamedTypeSymbol currentType = underlyingTupleType; 211if (currentType.Arity == NamedTypeSymbol.ValueTupleRestPosition) 213currentType = (NamedTypeSymbol)currentType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestPosition - 1].Type; 232private static NamedTypeSymbol ConstructTupleUnderlyingType(NamedTypeSymbol firstTupleType, NamedTypeSymbol? chainedTupleTypeOpt, ImmutableArray<TypeWithAnnotations> elementTypes) 240NamedTypeSymbol currentSymbol = firstTupleType.Construct(ImmutableArray.Create(elementTypes, (chainLength - 1) * (ValueTupleRestPosition - 1), remainder)); 252private static void ReportUseSiteAndObsoleteDiagnostics(CSharpSyntaxNode? syntax, BindingDiagnosticBag diagnostics, NamedTypeSymbol firstTupleType) 268NamedTypeSymbol firstTupleType = compilation.GetWellKnownType(GetTupleType(remainder)); 273NamedTypeSymbol chainedTupleType = compilation.GetWellKnownType(GetTupleType(ValueTupleRestPosition)); 487internal static Symbol? GetWellKnownMemberInType(NamedTypeSymbol type, WellKnownMember relativeMember, BindingDiagnosticBag diagnostics, SyntaxNode? syntax) 516static Symbol? GetWellKnownMemberInType(NamedTypeSymbol type, WellKnownMember relativeMember) 579NamedTypeSymbol currentValueTuple = this; 711var oldUnderlying = currentValueTuple; 712currentValueTuple = (NamedTypeSymbol)oldUnderlying.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestIndex].Type; 738NamedTypeSymbol container = getNestedTupleUnderlyingType(this, fieldChainLength - 1).OriginalDefinition; 788static NamedTypeSymbol getNestedTupleUnderlyingType(NamedTypeSymbol topLevelUnderlyingType, int depth) 790NamedTypeSymbol found = topLevelUnderlyingType; 793found = (NamedTypeSymbol)found.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestPosition - 1].Type; 854private TypeSymbol MergeTupleNames(NamedTypeSymbol other, NamedTypeSymbol mergedType) 918internal NamedTypeSymbol TupleUnderlyingType { get; } 920internal TupleExtraData(NamedTypeSymbol underlyingType) 930internal TupleExtraData(NamedTypeSymbol underlyingType, ImmutableArray<string?> elementNames, 968public ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 978static ImmutableArray<TypeWithAnnotations> collectTupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 1000public ImmutableArray<FieldSymbol> TupleElements(NamedTypeSymbol tuple) 1010ImmutableArray<FieldSymbol> collectTupleElementFields(NamedTypeSymbol tuple)
Symbols\TypeMap.cs (4)
62private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ForType(NamedTypeSymbol containingType) 70internal TypeMap(NamedTypeSymbol containingType, ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeWithAnnotations> typeArguments) 139internal TypeMap WithAlphaRename(NamedTypeSymbol oldOwner, NamedTypeSymbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters)
Symbols\TypeParameterBounds.cs (4)
25ImmutableArray<NamedTypeSymbol> interfaces, 26NamedTypeSymbol effectiveBaseClass, 57public readonly ImmutableArray<NamedTypeSymbol> Interfaces; 62public readonly NamedTypeSymbol EffectiveBaseClass;
Symbols\TypeParameterSymbol.cs (24)
134public NamedTypeSymbol DeclaringType 138return this.ContainingSymbol as NamedTypeSymbol; 155public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers() 157return ImmutableArray<NamedTypeSymbol>.Empty; 161public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name) 163return ImmutableArray<NamedTypeSymbol>.Empty; 167public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(ReadOnlyMemory<char> name, int arity) 169return ImmutableArray<NamedTypeSymbol>.Empty; 240internal sealed override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => null; 242internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved = null) 244return ImmutableArray<NamedTypeSymbol>.Empty; 247protected sealed override ImmutableArray<NamedTypeSymbol> GetAllInterfaces() 249return ImmutableArray<NamedTypeSymbol>.Empty; 259internal NamedTypeSymbol EffectiveBaseClassNoUseSiteDiagnostics 268internal NamedTypeSymbol EffectiveBaseClass(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 271var result = EffectiveBaseClassNoUseSiteDiagnostics; 284internal ImmutableArray<NamedTypeSymbol> EffectiveInterfacesNoUseSiteDiagnostics 293internal ImmutableArray<NamedTypeSymbol> EffectiveInterfacesWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 297foreach (var iface in result) 335internal ImmutableArray<NamedTypeSymbol> AllEffectiveInterfacesNoUseSiteDiagnostics 343internal ImmutableArray<NamedTypeSymbol> AllEffectiveInterfacesWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 355foreach (var iface in result) 385internal abstract ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress); 387internal abstract NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress);
Symbols\TypeSymbol.cs (60)
48internal ImmutableArray<NamedTypeSymbol> allInterfaces; 53internal MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> interfacesAndTheirBaseInterfaces; 55internal static readonly MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> EmptyInterfacesAndTheirBaseInterfaces = 56new MultiDictionary<NamedTypeSymbol, NamedTypeSymbol>(0, SymbolEqualityComparer.CLRSignature); 160internal abstract NamedTypeSymbol BaseTypeNoUseSiteDiagnostics { get; } 162internal NamedTypeSymbol BaseTypeWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 164var result = BaseTypeNoUseSiteDiagnostics; 174internal NamedTypeSymbol BaseTypeOriginalDefinition(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 176var result = BaseTypeNoUseSiteDiagnostics; 191internal abstract ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved = null); 203internal ImmutableArray<NamedTypeSymbol> AllInterfacesNoUseSiteDiagnostics 211internal ImmutableArray<NamedTypeSymbol> AllInterfacesWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 224foreach (var iface in result) 261var t = this.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 317protected virtual ImmutableArray<NamedTypeSymbol> GetAllInterfaces() 322return ImmutableArray<NamedTypeSymbol>.Empty; 337protected virtual ImmutableArray<NamedTypeSymbol> MakeAllInterfaces() 339var result = ArrayBuilder<NamedTypeSymbol>.GetInstance(); 340var visited = new HashSet<NamedTypeSymbol>(SymbolEqualityComparer.ConsiderEverything); 354static void addAllInterfaces(NamedTypeSymbol @interface, HashSet<NamedTypeSymbol> visited, ArrayBuilder<NamedTypeSymbol> result) 358ImmutableArray<NamedTypeSymbol> baseInterfaces = @interface.InterfacesNoUseSiteDiagnostics(); 361var baseInterface = baseInterfaces[i]; 380internal MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics 400internal MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> InterfacesAndTheirBaseInterfacesWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 415private static MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> MakeInterfacesAndTheirBaseInterfaces(ImmutableArray<NamedTypeSymbol> declaredInterfaces) 417var resultBuilder = new MultiDictionary<NamedTypeSymbol, NamedTypeSymbol>(declaredInterfaces.Length, SymbolEqualityComparer.CLRSignature, SymbolEqualityComparer.ConsiderEverything); 418foreach (var @interface in declaredInterfaces) 422foreach (var baseInterface in @interface.AllInterfacesNoUseSiteDiagnostics) 457return FindMostSpecificImplementation(interfaceMember, (NamedTypeSymbol)this, ref discardedUseSiteInfo); 730var interfaceType = interfaceMember.ContainingType; 809NamedTypeSymbol interfaceType = interfaceMember.ContainingType; 1007if (implementingType is NamedTypeSymbol named && 1101private static Symbol FindMostSpecificImplementation(Symbol interfaceMember, NamedTypeSymbol implementingInterface, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1149ImmutableArray<NamedTypeSymbol> allInterfaces = implementingType.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 1235NamedTypeSymbol implementingInterface = inplementingAccessor1.ContainingType; 1256ImmutableArray<NamedTypeSymbol> allInterfaces, 1261var implementations = ArrayBuilder<(MultiDictionary<Symbol, Symbol>.ValueSet MethodSet, MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> Bases)>.GetInstance(); 1263foreach (var interfaceType in allInterfaces) 1280(MultiDictionary<Symbol, Symbol>.ValueSet methodSet, MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> bases) = implementations[i]; 1282NamedTypeSymbol previousContainingType = previous.ContainingType; 1314MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> bases = interfaceType.InterfacesAndTheirBaseInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 1373internal static MultiDictionary<Symbol, Symbol>.ValueSet FindImplementationInInterface(Symbol interfaceMember, NamedTypeSymbol interfaceType) 1377NamedTypeSymbol containingType = interfaceMember.ContainingType; 2074var @interface = interfaceMember.ContainingType; 2138var @interface = interfaceMember.ContainingType; 2523foreach (FieldSymbol field in ((NamedTypeSymbol)this).OriginalDefinition.GetFieldsToEmit()) 2541elementField = elementField.AsMember((NamedTypeSymbol)this);
Symbols\TypeSymbolExtensions.cs (61)
28foreach (NamedTypeSymbol @interface in subType.AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 159if (type is NamedTypeSymbol nt 174RoslynDebug.Assert(type is NamedTypeSymbol); //not testing Kind because it may be an ErrorType 176return ((NamedTypeSymbol)type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 214public static NamedTypeSymbol? GetEnumUnderlyingType(this TypeSymbol? type) 216return (type is NamedTypeSymbol namedType) ? namedType.EnumUnderlyingType : null; 227var underlyingType = type.GetEnumUnderlyingType(); 329return type.Kind == SymbolKind.NamedType && ((NamedTypeSymbol)type).IsInterface; 380if (type is NamedTypeSymbol 416internal static ImmutableArray<NamedTypeSymbol> GetAllInterfacesOrEffectiveInterfaces(this TypeSymbol type) 430return ImmutableArray<NamedTypeSymbol>.Empty; 437public static NamedTypeSymbol? GetDelegateType(this TypeSymbol? type) 442type = ((NamedTypeSymbol)type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type; 445return type.IsDelegateType() ? (NamedTypeSymbol)type : null; 478if (_type.OriginalDefinition is NamedTypeSymbol type) 518if (!(type is NamedTypeSymbol t)) 600elementTypes = ((NamedTypeSymbol)type).TupleElementTypesWithAnnotations; 707return !IsAsRestrictive((NamedTypeSymbol)type, sym, ref useSiteInfo); 782var containingType = current.ContainingType; 889var typeArguments = ((NamedTypeSymbol)current).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 1042var parent1 = s1.ContainingType; 1052for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1064var parent2 = s2.ContainingType; 1076var parent1 = s1.ContainingType; 1094for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1154NamedTypeSymbol parent1 = s1.ContainingType; 1161var parent1OriginalDefinition = parent1.OriginalDefinition; 1162for (var parent2 = s2.ContainingType; (object)parent2 != null; parent2 = parent2.ContainingType) 1183return type is NamedTypeSymbol { IsUnboundGenericType: true }; 1186public static bool IsTopLevelType(this NamedTypeSymbol type) 1367return type is NamedTypeSymbol 1380return type is NamedTypeSymbol 1393return type is NamedTypeSymbol 1404return type is NamedTypeSymbol 1415return type is NamedTypeSymbol 1481var foundType = type.VisitType(predicate: (type, _, _) => type is NamedTypeSymbol { IsFileLocal: true }, arg: (object?)null); 1485internal static string? GetFileLocalTypeMetadataNamePrefix(this NamedTypeSymbol type) 1523return ((NamedTypeSymbol)type).EnumUnderlyingType.SpecialType.IsValidVolatileFieldType(); 1567internal static int ComputeHashCode(this NamedTypeSymbol type) 1609static bool wasConstructedForAnnotations(NamedTypeSymbol type) 1642public static TypeSymbol AsDynamicIfNoPia(this TypeSymbol type, NamedTypeSymbol containingType) 1647public static bool TryAsDynamicIfNoPia(this TypeSymbol type, NamedTypeSymbol containingType, [NotNullWhen(true)] out TypeSymbol? result) 1684internal static ImmutableArray<TypeParameterSymbol> GetAllTypeParameters(this NamedTypeSymbol type) 1701internal static void GetAllTypeParameters(this NamedTypeSymbol type, ArrayBuilder<TypeParameterSymbol> result) 1703var containingType = type.ContainingType; 1716internal static TypeParameterSymbol? FindEnclosingTypeParameter(this NamedTypeSymbol type, string name) 1773internal static bool HasNameQualifier(this NamedTypeSymbol type, string qualifiedName) 1830var namedType = type as NamedTypeSymbol; 1848if (!(type is NamedTypeSymbol { Arity: 1 } namedType)) 1861if (!(type is NamedTypeSymbol { Arity: 1 } namedType)) 1871if (!(type is NamedTypeSymbol { Arity: 1 } namedType)) 1889internal static bool IsCustomTaskType(this NamedTypeSymbol type, [NotNullWhen(true)] out TypeSymbol? builderArgument) 1922var namedType = (NamedTypeSymbol)type; 1963private static bool NormalizeTaskTypesInNamedType(CSharpCompilation compilation, ref NamedTypeSymbol type) 1986var originalType = type; 1987var originalDefinition = originalType.OriginalDefinition; 1999var taskType = compilation.GetWellKnownType( 2136return typeSymbol is NamedTypeSymbol { Name: WellKnownMemberNames.LockTypeName, Arity: 0, ContainingType: null } && 2169return type is NamedTypeSymbol { Name: "INumberBase", IsInterface: true, Arity: 1, ContainingType: null } &&
Symbols\TypeUnification.cs (6)
148NamedTypeSymbol nt1 = (NamedTypeSymbol)t1.Type; 149NamedTypeSymbol nt2 = (NamedTypeSymbol)t2.Type; 276NamedTypeSymbol namedType = (NamedTypeSymbol)type;
Symbols\TypeWithAnnotations.cs (2)
608var namedType = type as NamedTypeSymbol;
Symbols\UnboundGenericType.cs (6)
19public static NamedTypeSymbol AsUnboundGenericType(this NamedTypeSymbol type) 27var original = type.OriginalDefinition; 29NamedTypeSymbol originalContainingType = original.ContainingType; 31var constructedFrom = ((object)originalContainingType == null) ? 72protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
Symbols\UnsupportedMetadataTypeSymbol.cs (1)
20protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
Symbols\VarianceSafety.cs (10)
29internal static void CheckInterfaceVarianceSafety(this NamedTypeSymbol interfaceType, BindingDiagnosticBag diagnostics) 33foreach (NamedTypeSymbol baseInterface in interfaceType.InterfacesNoUseSiteDiagnostics()) 62CheckNestedTypeVarianceSafety((NamedTypeSymbol)member, diagnostics); 71private static void CheckNestedTypeVarianceSafety(NamedTypeSymbol member, BindingDiagnosticBag diagnostics) 86NamedTypeSymbol container = GetEnclosingVariantInterface(member); 96internal static NamedTypeSymbol GetEnclosingVariantInterface(Symbol member) 98for (var container = member.ContainingType; container is object; container = container.ContainingType) 335var namedType = (NamedTypeSymbol)type; 357NamedTypeSymbol namedType,
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (3)
28protected readonly NamedTypeSymbol _underlyingType; 30public WrappedNamedTypeSymbol(NamedTypeSymbol underlyingType, TupleExtraData tupleData) 37public NamedTypeSymbol UnderlyingNamedType
Syntax\SyntaxFacts.cs (1)
510return NamedTypeSymbol.IsTupleElementNameReserved(elementName) != -1;
Utilities\TypeSymbolExtensions.cs (14)
52var namedType = (NamedTypeSymbol)type; 135var namedType = (NamedTypeSymbol)type; 179internal static TypeSymbol GetNextBaseTypeNoUseSiteDiagnostics(this TypeSymbol type, ConsList<TypeSymbol> basesBeingResolved, CSharpCompilation compilation, ref PooledHashSet<NamedTypeSymbol> visited) 190return GetNextDeclaredBase((NamedTypeSymbol)type, basesBeingResolved, compilation, ref visited); 209private static TypeSymbol GetNextDeclaredBase(NamedTypeSymbol type, ConsList<TypeSymbol> basesBeingResolved, CSharpCompilation compilation, ref PooledHashSet<NamedTypeSymbol> visited) 225var nextType = type.GetDeclaredBaseType(basesBeingResolved); 234var origType = type.OriginalDefinition; 243visited = visited ?? PooledHashSet<NamedTypeSymbol>.GetInstance(); 254private static void SetKnownToHaveNoDeclaredBaseCycles(ref PooledHashSet<NamedTypeSymbol> visited) 268private static NamedTypeSymbol GetDefaultBaseOrNull(NamedTypeSymbol type, CSharpCompilation compilation)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (64)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
6567var symbol = comp.GetWellKnownType(type);
CodeGen\CodeGenTupleTest.cs (62)
5794var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, intType); 5816var vt0 = comp.GetWellKnownType(WellKnownType.System_ValueTuple); 5828var vt8 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 5854var vt1 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T1).Construct(intType); 5872var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 5907var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 5939var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 5949var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 5971var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, stringType); 5990var vt3 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T3).Construct(intType, stringType, intType); 6007var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, intType); 6026var vt8 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 6052var vt8 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 6079var vt8 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 6104var vt9 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 6129var vt9 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 6155var originalVT2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 6157var vt2 = originalVT2.Construct(intType, intType); 6161var vt9 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_TRest) 6188var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 6189var vt2WithErrorType = vt2.Construct(intType, ErrorTypeSymbol.UnknownResultType); 6191var tupleWithoutNames = ((Symbols.PublicModel.NamedTypeSymbol)comp.CreateTupleTypeSymbol(vt2WithErrorType, elementNames: default)).UnderlyingNamedTypeSymbol; 6271var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, intType); 6272var vt3 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T3).Construct(intType, intType, intType); 6293var vt2 = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2).Construct(intType, intType); 13589var t1 = NamedTypeSymbol.CreateTuple(m1Tuple); 13590var t2 = NamedTypeSymbol.CreateTuple(m1Tuple); 13595var t3 = NamedTypeSymbol.CreateTuple(m1Tuple, ImmutableArray.Create("a", "b")); 13596var t4 = NamedTypeSymbol.CreateTuple(m1Tuple, ImmutableArray.Create("a", "b")); 13597var t5 = NamedTypeSymbol.CreateTuple(m1Tuple, ImmutableArray.Create("b", "a")); 13612var t6 = NamedTypeSymbol.CreateTuple(m1Tuple, ImmutableArray.Create("Item1", "Item2")); 13613var t7 = NamedTypeSymbol.CreateTuple(m1Tuple, ImmutableArray.Create("Item1", "Item2")); 13623var t8 = NamedTypeSymbol.CreateTuple(m1Tuple, ImmutableArray.Create("Item2", "Item1")); 13638var t1 = NamedTypeSymbol.CreateTuple(m2Tuple, default(ImmutableArray<string>)); 13639var t2 = NamedTypeSymbol.CreateTuple(m2Tuple, default(ImmutableArray<string>)); 13644var t3 = NamedTypeSymbol.CreateTuple(m2Tuple, 13646var t4 = NamedTypeSymbol.CreateTuple(m2Tuple, 13648var t5 = NamedTypeSymbol.CreateTuple(m2Tuple, 13664var t6 = NamedTypeSymbol.CreateTuple(m2Tuple, 13666var t7 = NamedTypeSymbol.CreateTuple(m2Tuple, 13677var t8 = NamedTypeSymbol.CreateTuple(m2Tuple, 13690var t9 = NamedTypeSymbol.CreateTuple(m2Tuple, 13692var t10 = NamedTypeSymbol.CreateTuple(m2Tuple, 13698var t11 = NamedTypeSymbol.CreateTuple(m2Tuple.OriginalDefinition.Construct( 13754var t12 = NamedTypeSymbol.CreateTuple(m2Tuple.OriginalDefinition.Construct( 13815var t13 = NamedTypeSymbol.CreateTuple(m2Tuple.OriginalDefinition.Construct( 13828var t1 = NamedTypeSymbol.CreateTuple(m3Tuple); 13829var t2 = NamedTypeSymbol.CreateTuple(m3Tuple); 13834var t3 = NamedTypeSymbol.CreateTuple(m3Tuple, ImmutableArray.Create("a", "b", "c")); 13835var t4 = NamedTypeSymbol.CreateTuple(m3Tuple, ImmutableArray.Create("a", "b", "c")); 13836var t5 = NamedTypeSymbol.CreateTuple(m3Tuple, ImmutableArray.Create("c", "b", "a")); 13851var t6 = NamedTypeSymbol.CreateTuple(m3Tuple, ImmutableArray.Create("Item1", "Item2", "Item3")); 13852var t7 = NamedTypeSymbol.CreateTuple(m3Tuple, ImmutableArray.Create("Item1", "Item2", "Item3")); 13862var t8 = NamedTypeSymbol.CreateTuple(m3Tuple, ImmutableArray.Create("Item2", "Item3", "Item1")); 25329var found = comp.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 25334var tuple2 = comp2.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 25340var tuple3 = comp3.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 25346var tuple4 = comp4.GetWellKnownType(WellKnownType.System_ValueTuple_T2); 26971var container = contained.ContainingType; 27469var underlyingType = type.TupleUnderlyingType; 28993var obliviousOriginalTuple = NamedTypeSymbol.CreateTuple( 29011var nullableEnabledTuple = NamedTypeSymbol.CreateTuple(
Emit\EmitMetadataTests.cs (1)
1182var containingType = property.ContainingType;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (17)
Attributes\AttributeTests_IsByRefLike.cs (1)
1091var typeSymbol = assembly.GetTypeByMetadataName(expectedTypeName);
Attributes\AttributeTests_Nullable.cs (3)
801var type = assembly.GetTypeByMetadataName("C"); 815var type = assembly.GetTypeByMetadataName("C"); 974var type = assembly.GetTypeByMetadataName("C");
Attributes\AttributeTests_ReadOnlyStruct.cs (1)
658var typeSymbol = assembly.GetTypeByMetadataName(expectedTypeName);
Attributes\AttributeTests_RefReadOnly.cs (1)
2550var typeSymbol = assembly.GetTypeByMetadataName(expectedTypeName);
Semantics\CollectionExpressionTests.cs (11)
4990var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Generic_List_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 5045var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Generic_List_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 5099var listType = comp.GetWellKnownType(WellKnownType.System_Collections_Generic_List_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 19280var originalType = collectionType.OriginalDefinition; 19340var originalType = collectionType.OriginalDefinition; 19395var originalType = collectionType.OriginalDefinition; 30133var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 30193var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 30404var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 30463var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T).Construct(comp.GetSpecialType(SpecialType.System_Int32)); 30517var collectionType = comp.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T).Construct(comp.GetSpecialType(SpecialType.System_Int32));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (16)
Semantics\DelegateTypeTests.cs (5)
14775var funcOfT = comp.GetWellKnownType(WellKnownType.System_Func_T); 15593var funcOfT = comp.GetWellKnownType(WellKnownType.System_Func_T); 15594var funcOfObjectNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(objectType, NullableAnnotation.Annotated))); 15595var funcOfStringNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.Annotated))); 15596var funcOfStringNotNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.NotAnnotated)));
Semantics\NativeIntegerTests.cs (11)
1545var underlyingType = type.NativeIntegerUnderlyingType; 1559var def = comp.GetWellKnownType(WellKnownType.System_IEquatable_T); 1827var underlyingType = type.NativeIntegerUnderlyingType; 1987var underlyingType = type.NativeIntegerUnderlyingType; 2151var underlyingType = type.NativeIntegerUnderlyingType; 2250var underlyingType = type.NativeIntegerUnderlyingType; 2366var underlyingType = type.NativeIntegerUnderlyingType; 2486var underlyingType = type.NativeIntegerUnderlyingType; 2642var underlyingType = type.NativeIntegerUnderlyingType; 2744var underlyingType = type.NativeIntegerUnderlyingType; 2884var underlyingType = type.NativeIntegerUnderlyingType;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (46)
Compilation\CompilationAPITests.cs (2)
1730var taskOfT = compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T); 1731var taskOfObject = taskOfT.Construct(compilation.ObjectType);
Symbols\AssemblyAndNamespaceTests.cs (1)
433var taskType = comp.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task);
Symbols\CompilationCreationTests.cs (1)
2298var retval2 = retval1.ContainingType;
Symbols\CorLibrary\CorTypes.cs (5)
36var t = noMsCorLibRef.GetSpecialType((SpecialType)i); 65var t = msCorLibRef.GetSpecialType((SpecialType)i); 82var t = msCorLibRef.GetSpecialType((InternalSpecialType)i); 145var t = msCorLibRef.GetSpecialType((SpecialType)i); 164var t = msCorLibRef.GetSpecialType((InternalSpecialType)i);
Symbols\CovariantReturnTests.cs (1)
359var constructedType = genericType.Construct(typeArguments.Select(n => (TypeSymbol)comp.GlobalNamespace.GetMember(n)));
Symbols\DefaultInterfaceImplementationTests.cs (9)
34842var test1i1 = i1.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int32)); 34846var test2i1 = i1.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int64)); 34849var test2i2 = i2.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int64)); 39139var test1i1 = i1.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int32)); 39142var test2i1 = i1.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int64)); 39144var test2i2 = i2.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int64)); 41815var test1i1 = i1.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int32)); 41818var test2i1 = i1.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int64)); 41820var test2i2 = i2.Construct(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int64));
Symbols\ExtensionMethodTests.cs (1)
2850var msi = myStruct.Construct(int32Type);
Symbols\Metadata\PE\DynamicTransformsTests.cs (11)
73var outerClassOfDynamic = _outerClass.Construct(s_dynamicType); 91var base1OfDynamic = _base1Class.Construct(s_dynamicType); 97var base2OfDynamicV = _base2Class.Construct(s_dynamicType, _innerClass.TypeParameters[1]); 162var outerOfT = _outerClass.Construct(derivedTypeParam); 165var outerClassOfDynamic = _outerClass.Construct(s_dynamicType); 180var complicatedOuter = _outerClass.Construct(innerOfTDynamicWithOuterOfDynamic); 258var inner3OfDynamic = _inner3Class.Construct(s_dynamicType); 288var outerClassOfDynamic = _outerClass.Construct(s_dynamicType); 336var outerClassOfDynamic = _outerClass.Construct(s_dynamicType); 356var baseType = _base2Class.Construct(arrayOfPointerToInt, complicatedInnerInnerArrayOfArray); 375var outerClassOfDynamic = _outerClass.Construct(s_dynamicType);
Symbols\Metadata\PE\LoadingEvents.cs (1)
361var @interface = interfaceEvent.ContainingType;
Symbols\Metadata\PE\LoadingMethods.cs (1)
733var @interface = interfaceMethod.ContainingType;
Symbols\Metadata\PE\LoadingProperties.cs (1)
196var @interface = interfaceProperty.ContainingType;
Symbols\Metadata\PE\MissingTypeReferences.cs (1)
86var constructedFrom = genericBase.ConstructedFrom;
Symbols\Metadata\PE\TypeForwarders.cs (2)
1496var type = assembly.ResolveForwardedType(fullName); 1765var type = assembly.ResolveForwardedType(fullName);
Symbols\MissingSpecialMember.cs (5)
271var wellKnownType = comp.GetWellKnownType(WellKnownType.System_Type); 304var wellKnownType = comp.GetWellKnownType(WellKnownType.System_Diagnostics_DebuggableAttribute__DebuggingModes); 381var wellKnownType = comp.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T); 497var wellKnown = comp.GetWellKnownType(WellKnownType.System_Type); 685var symbol = comp.GetWellKnownType(wkt);
Symbols\Source\EnumTests.cs (1)
1009var type = symEnum.EnumUnderlyingType;
Symbols\Source\TypeMapTests.cs (3)
146var c1OfByteChar_c2OfIntInt = c1OfByteChar_c2.Construct(_int, _int); 151var c1OfByteChar_c2OfIntInt_c3OfIntByte = c1OfByteChar_c2OfIntInt_c3.Construct(_int, _byte); 190var c1OfByteChar_c2OfIntInt = c1OfByteChar_c2.Construct(_byte, _char, _int, _int);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdEventTests.cs (2)
3574var tokenType = compilation.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_EventRegistrationToken); 3593var expectedFieldType = compilation.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_EventRegistrationTokenTable_T).Construct(eventType.Type);