Fix direct initialization.
This commit is contained in:
@@ -103,7 +103,7 @@ class Constructor {
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
addStatement((function () {
|
addStatement((function () {
|
||||||
var fields = [for (f in Context.getLocalClass().get().fields.get()) f.name => f];
|
var fields = [for (f in (macro this).typeof().sure().getClass().fields.get()) f.name => f];
|
||||||
|
|
||||||
function setDirectly(t:TypedExpr) {
|
function setDirectly(t:TypedExpr) {
|
||||||
var direct = null;
|
var direct = null;
|
||||||
@@ -120,12 +120,8 @@ class Constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return switch fields[name] {
|
return switch fields[name] {
|
||||||
case null: //trace(Context.getLocalClass().get().fields.get().length); throw ('assert');
|
case null:
|
||||||
macro @:pos(pos) {
|
pos.error('this direct initialization causes the compiler to do really weird things');
|
||||||
var v = this.$name;
|
|
||||||
v = $e;
|
|
||||||
(cast this).$name = v;
|
|
||||||
}
|
|
||||||
case f:
|
case f:
|
||||||
switch f.kind {
|
switch f.kind {
|
||||||
case FVar(_, AccNormal | AccNo):
|
case FVar(_, AccNormal | AccNo):
|
||||||
|
|||||||
Reference in New Issue
Block a user