Skip to content

Commit

Permalink
fix compiler support for #77
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed Sep 15, 2021
1 parent 1bc1424 commit 6cf9565
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/compilation/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public void LinkMetadata((ClassBuilder @class, ClassDeclarationSyntax member) x)
owner ??= new TypeSyntax(new IdentifierExpression("Object"))
.SetPos<TypeSyntax>(member.Identifier.Transform); // fallback transform

@class.Parent = FetchType(owner, doc);
@class.Parents.Add(FetchType(owner, doc));
}
public (
List<(MethodBuilder method, MethodDeclarationSyntax syntax)> methods,
Expand Down Expand Up @@ -362,11 +362,11 @@ public void GenerateCtor((ClassBuilder @class, ClassDeclarationSyntax member) x)

gen.StoreIntoMetadata("context", Context);

// emit calling based ctors
@class.Parents.Select(z => z.GetDefaultCtor()).Where(z => z != null)
.Pipe(z => gen.Emit(OpCodes.CALL, z));

var pctor = @class.Parent?.GetDefaultCtor();

if (pctor is not null) // for Object, ValueType
gen.Emit(OpCodes.CALL, pctor); // call parent ctor
var pregen = new List<(ExpressionSyntax exp, ManaField field)>();


Expand Down

0 comments on commit 6cf9565

Please sign in to comment.