diff --git a/src/Draco.Compiler/Internal/Symbols/Generic/FieldInstanceSymbol.cs b/src/Draco.Compiler/Internal/Symbols/Generic/FieldInstanceSymbol.cs index 15966daae..fa13a5306 100644 --- a/src/Draco.Compiler/Internal/Symbols/Generic/FieldInstanceSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/Generic/FieldInstanceSymbol.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Linq; using System.Threading; using Draco.Compiler.Api.Syntax; @@ -28,4 +30,8 @@ internal sealed class FieldInstanceSymbol( private TypeSymbol BuildType() => this.GenericDefinition.Type.GenericInstantiate(this.GenericDefinition.Type.ContainingSymbol, this.Context); + + protected internal override IEnumerable GetAdditionalSymbols() => this.GenericDefinition + .GetAdditionalSymbols() + .Select(s => s.GenericInstantiate(this, this.Context)); } diff --git a/src/Draco.Compiler/Internal/Symbols/Generic/FunctionInstanceSymbol.cs b/src/Draco.Compiler/Internal/Symbols/Generic/FunctionInstanceSymbol.cs index c3c6010ef..38b8260f0 100644 --- a/src/Draco.Compiler/Internal/Symbols/Generic/FunctionInstanceSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/Generic/FunctionInstanceSymbol.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Text; @@ -137,4 +138,8 @@ private ImmutableArray BuildParameters() => this.GenericDefinit private TypeSymbol BuildReturnType() => this.GenericDefinition.ReturnType.GenericInstantiate(this.GenericDefinition.ReturnType.ContainingSymbol, this.Context); + + protected internal override IEnumerable GetAdditionalSymbols() => this.GenericDefinition + .GetAdditionalSymbols() + .Select(s => s.GenericInstantiate(this, this.Context)); } diff --git a/src/Draco.Compiler/Internal/Symbols/Generic/ParameterInstanceSymbol.cs b/src/Draco.Compiler/Internal/Symbols/Generic/ParameterInstanceSymbol.cs index 386fcecd3..7a91d4c44 100644 --- a/src/Draco.Compiler/Internal/Symbols/Generic/ParameterInstanceSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/Generic/ParameterInstanceSymbol.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Linq; using System.Threading; using Draco.Compiler.Api.Syntax; @@ -26,4 +28,8 @@ internal sealed class ParameterInstanceSymbol( private TypeSymbol BuildType() => this.GenericDefinition.Type.GenericInstantiate(this.GenericDefinition.Type.ContainingSymbol, this.Context); + + protected internal override IEnumerable GetAdditionalSymbols() => this.GenericDefinition + .GetAdditionalSymbols() + .Select(s => s.GenericInstantiate(this, this.Context)); } diff --git a/src/Draco.Compiler/Internal/Symbols/Generic/PropertyAccessorInstanceSymbol.cs b/src/Draco.Compiler/Internal/Symbols/Generic/PropertyAccessorInstanceSymbol.cs index 031a3e6f9..4afe03c43 100644 --- a/src/Draco.Compiler/Internal/Symbols/Generic/PropertyAccessorInstanceSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/Generic/PropertyAccessorInstanceSymbol.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Linq; using Draco.Compiler.Api.Syntax; namespace Draco.Compiler.Internal.Symbols.Generic; @@ -17,4 +19,8 @@ internal sealed class PropertyAccessorInstanceSymbol( public PropertySymbol Property { get; } = property; public override Api.Semantics.Visibility Visibility => this.GenericDefinition.Visibility; public override SyntaxNode? DeclaringSyntax => this.GenericDefinition.DeclaringSyntax; + + protected internal override IEnumerable GetAdditionalSymbols() => this.GenericDefinition + .GetAdditionalSymbols() + .Select(s => s.GenericInstantiate(this, this.Context)); } diff --git a/src/Draco.Compiler/Internal/Symbols/Generic/PropertyInstanceSymbol.cs b/src/Draco.Compiler/Internal/Symbols/Generic/PropertyInstanceSymbol.cs index d2499af82..6f7dae3c7 100644 --- a/src/Draco.Compiler/Internal/Symbols/Generic/PropertyInstanceSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/Generic/PropertyInstanceSymbol.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Linq; using System.Threading; using Draco.Compiler.Api.Syntax; using Draco.Compiler.Internal.Utilities; @@ -44,4 +46,8 @@ private TypeSymbol BuildType() => private FunctionSymbol? BuildSetter() => this.GenericDefinition.Setter is not null ? new PropertyAccessorInstanceSymbol(this.ContainingSymbol, this.GenericDefinition.Setter, this.Context, this) : null; + + protected internal override IEnumerable GetAdditionalSymbols() => this.GenericDefinition + .GetAdditionalSymbols() + .Select(s => s.GenericInstantiate(this, this.Context)); } diff --git a/src/Draco.Compiler/Internal/Symbols/Generic/TypeInstanceSymbol.cs b/src/Draco.Compiler/Internal/Symbols/Generic/TypeInstanceSymbol.cs index 88bc8f70c..54aabc4cb 100644 --- a/src/Draco.Compiler/Internal/Symbols/Generic/TypeInstanceSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/Generic/TypeInstanceSymbol.cs @@ -141,4 +141,8 @@ private void BuildGenerics() private ImmutableArray BuildDefinedMembers() => this.GenericDefinition.DefinedMembers .Select(m => m.GenericInstantiate(this, this.Context)) .ToImmutableArray(); + + protected internal override IEnumerable GetAdditionalSymbols() => this.GenericDefinition + .GetAdditionalSymbols() + .Select(s => s.GenericInstantiate(this, this.Context)); } diff --git a/src/Draco.Compiler/Internal/Symbols/TypeSymbol.cs b/src/Draco.Compiler/Internal/Symbols/TypeSymbol.cs index b23fdd510..bf9b41f3c 100644 --- a/src/Draco.Compiler/Internal/Symbols/TypeSymbol.cs +++ b/src/Draco.Compiler/Internal/Symbols/TypeSymbol.cs @@ -215,7 +215,7 @@ public override TypeSymbol GenericInstantiate(Symbol? containingSymbol, GenericC public override abstract string ToString(); - protected internal override sealed IEnumerable GetAdditionalSymbols() + protected internal override IEnumerable GetAdditionalSymbols() { if (this.IsAbstract) yield break; // For non-abstract types we provide constructor functions