Skip to content

Commit

Permalink
EEEEE
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Nov 12, 2024
1 parent 2dbd54c commit 9b5951c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Draco.Compiler.Api.Syntax;

Expand Down Expand Up @@ -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<Symbol> GetAdditionalSymbols() => this.GenericDefinition
.GetAdditionalSymbols()
.Select(s => s.GenericInstantiate(this, this.Context));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -137,4 +138,8 @@ private ImmutableArray<ParameterSymbol> BuildParameters() => this.GenericDefinit

private TypeSymbol BuildReturnType() =>
this.GenericDefinition.ReturnType.GenericInstantiate(this.GenericDefinition.ReturnType.ContainingSymbol, this.Context);

protected internal override IEnumerable<Symbol> GetAdditionalSymbols() => this.GenericDefinition
.GetAdditionalSymbols()
.Select(s => s.GenericInstantiate(this, this.Context));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Draco.Compiler.Api.Syntax;

Expand Down Expand Up @@ -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<Symbol> GetAdditionalSymbols() => this.GenericDefinition
.GetAdditionalSymbols()
.Select(s => s.GenericInstantiate(this, this.Context));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Draco.Compiler.Api.Syntax;

namespace Draco.Compiler.Internal.Symbols.Generic;
Expand All @@ -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<Symbol> GetAdditionalSymbols() => this.GenericDefinition
.GetAdditionalSymbols()
.Select(s => s.GenericInstantiate(this, this.Context));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Draco.Compiler.Api.Syntax;
using Draco.Compiler.Internal.Utilities;
Expand Down Expand Up @@ -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<Symbol> GetAdditionalSymbols() => this.GenericDefinition
.GetAdditionalSymbols()
.Select(s => s.GenericInstantiate(this, this.Context));
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,8 @@ private void BuildGenerics()
private ImmutableArray<Symbol> BuildDefinedMembers() => this.GenericDefinition.DefinedMembers
.Select(m => m.GenericInstantiate(this, this.Context))
.ToImmutableArray();

protected internal override IEnumerable<Symbol> GetAdditionalSymbols() => this.GenericDefinition
.GetAdditionalSymbols()
.Select(s => s.GenericInstantiate(this, this.Context));
}
2 changes: 1 addition & 1 deletion src/Draco.Compiler/Internal/Symbols/TypeSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public override TypeSymbol GenericInstantiate(Symbol? containingSymbol, GenericC

public override abstract string ToString();

protected internal override sealed IEnumerable<Symbol> GetAdditionalSymbols()
protected internal override IEnumerable<Symbol> GetAdditionalSymbols()
{
if (this.IsAbstract) yield break;
// For non-abstract types we provide constructor functions
Expand Down

0 comments on commit 9b5951c

Please sign in to comment.