Do not lose constructor metadata.

This commit is contained in:
back2dos
2015-05-18 14:48:35 +02:00
parent 6b8aefa7ca
commit 78e9087ba2
2 changed files with 4 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ class ClassBuilder {
macros.set(field.name, field)
else if (field.name == 'new') {
var m:Member = field;
this.constructor = new Constructor(this, m.getFunction().sure(), m.isPublic, m.pos);
this.constructor = new Constructor(this, m.getFunction().sure(), m.isPublic, m.pos, m.meta);
}
else
addMember(field);

View File

@@ -21,6 +21,7 @@ class Constructor {
var onGenerateHooks:Array<Function->Void>;
var superCall:Expr;
var owner:ClassBuilder;
var meta:Metadata;
public var isPublic:Null<Bool>;
public function new(owner:ClassBuilder, f:Function, ?isPublic:Null<Bool> = null, ?pos:Position, ?meta:Metadata) {
@@ -33,6 +34,7 @@ class Constructor {
this.args = [];
this.beforeArgs = [];
this.afterArgs = [];
this.meta = meta;
this.oldStatements =
if (f == null) [];
@@ -129,7 +131,7 @@ class Constructor {
access : isPublic ? [APublic] : [],
kind : FFun(f),
pos : pos,
meta : []
meta : this.meta,
}
}
}