internal static NamedTypeSymbol BuildSymbol( this MergedTypeDeclaration declaration, NamespaceOrTypeSymbol parent, DiagnosticBag diagnostics) { return(new SourceNamedTypeSymbol(parent, declaration, diagnostics)); }
internal SimpleProgramNamedTypeSymbol(NamespaceSymbol globalNamespace, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(globalNamespace, declaration, diagnostics) { Debug.Assert(globalNamespace.IsGlobalNamespace); Debug.Assert(declaration.Kind == DeclarationKind.SimpleProgram); Debug.Assert(declaration.Name == WellKnownMemberNames.TopLevelStatementsEntryPointTypeName); state.NotePartComplete(CompletionPart.EnumUnderlyingType); // No work to do for this. }
internal ImplicitNamedTypeSymbol(NamespaceOrTypeSymbol containingSymbol, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(containingSymbol, declaration, diagnostics) { Debug.Assert(declaration.Kind == DeclarationKind.ImplicitClass || declaration.Kind == DeclarationKind.Submission || declaration.Kind == DeclarationKind.Script); state.NotePartComplete(CompletionPart.EnumUnderlyingType); // No work to do for this. }
internal SimpleProgramNamedTypeSymbol(NamespaceSymbol globalNamespace, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(globalNamespace, declaration, diagnostics) { Debug.Assert(globalNamespace.IsGlobalNamespace); Debug.Assert(declaration.Kind == DeclarationKind.SimpleProgram); Debug.Assert(declaration.Name == UnspeakableName); state.NotePartComplete(CompletionPart.EnumUnderlyingType); // No work to do for this. }
internal SourceNamedTypeSymbol(NamespaceOrTypeSymbol containingSymbol, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(containingSymbol, declaration, diagnostics) { Debug.Assert(declaration.Kind == DeclarationKind.Struct || declaration.Kind == DeclarationKind.Interface || declaration.Kind == DeclarationKind.Enum || declaration.Kind == DeclarationKind.Delegate || declaration.Kind == DeclarationKind.Class); if (containingSymbol.Kind == SymbolKind.NamedType) { // Nested types are never unified. lazyIsExplicitDefinitionOfNoPiaLocalType = ThreeState.False; } }
internal SourceNamedTypeSymbol(NamespaceOrTypeSymbol containingSymbol, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(containingSymbol, declaration, diagnostics) { Debug.Assert(declaration.Kind == DeclarationKind.Struct || declaration.Kind == DeclarationKind.Interface || declaration.Kind == DeclarationKind.Enum || declaration.Kind == DeclarationKind.Delegate || declaration.Kind == DeclarationKind.Class); if (containingSymbol.Kind == SymbolKind.NamedType) { // Nested types are never unified. _lazyIsExplicitDefinitionOfNoPiaLocalType = ThreeState.False; } }
private Dictionary <string, ImmutableArray <NamespaceOrTypeSymbol> > MakeNameToMembersMap(DiagnosticBag diagnostics) { var builder = new NameToSymbolMapBuilder(_declaration.Children.Length); foreach (var declaration in _declaration.Children) { MergedNamespaceOrTypeDeclaration mergedDeclaration = null; if (declaration is SingleTypeDeclaration typeDeclaration) { mergedDeclaration = new MergedTypeDeclaration(ImmutableArray.Create((SingleTypeDeclaration)declaration)); } if (mergedDeclaration != null) { builder.Add(BuildSymbol(mergedDeclaration, diagnostics)); } else { throw ExceptionUtilities.UnexpectedValue(declaration.Kind); } } return(builder.CreateMap()); }
internal SourceNamedTypeSymbol(NamespaceOrTypeSymbol containingSymbol, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(containingSymbol, declaration, diagnostics) { Debug.Assert(declaration.Kind == DeclarationKind.Struct || declaration.Kind == DeclarationKind.Interface || declaration.Kind == DeclarationKind.Enum || declaration.Kind == DeclarationKind.Delegate || declaration.Kind == DeclarationKind.Class); if (containingSymbol.Kind == SymbolKind.NamedType) { // Nested types are never unified. _lazyIsExplicitDefinitionOfNoPiaLocalType = ThreeState.False; } if (declaration.Arity == 0 && declaration.HasConstraints) { foreach (var syntaxRef in this.SyntaxReferences) { var constraintClauses = GetConstraintClauses((CSharpSyntaxNode)syntaxRef.GetSyntax()); ReportErrorIfHasConstraints(constraintClauses, diagnostics); } } }
internal ImplicitTypeSymbol(NamespaceOrTypeSymbol containingSymbol, MergedTypeDeclaration declaration, DiagnosticBag diagnostics) : base(containingSymbol, declaration, diagnostics) { }