Various little fixes.

This commit is contained in:
Juraj Kirchheim
2018-04-02 13:06:42 +02:00
parent 74e37b4bf1
commit f051345863
3 changed files with 13 additions and 2 deletions

View File

@@ -74,7 +74,11 @@ class BuildCache {
var compound = ComplexType.TAnonymous([for (i in 0...types.length) {
name: 't$i',
pos: pos,
kind: FVar(types[i].toComplexType()),
kind: FVar(switch types[i] {
case TInst(_.get().kind => KExpr(e), _):
TPath('tink.macro.ConstParam'.asTypePath([TPExpr(e)]));
case t: t.toComplex();
}),
}]).toType();
return getType(name, compound, pos, function (ctx) return build({

View File

@@ -0,0 +1,3 @@
package tink.macro;
class ConstParam<Const> {}

View File

@@ -121,7 +121,11 @@ class Constructor {
return switch fields[name] {
case null: //trace(Context.getLocalClass().get().fields.get().length); throw ('assert');
macro @:pos(pos) this.$name = $e;
macro @:pos(pos) {
var v = this.$name;
v = $e;
(cast this).$name = v;
}
case f:
switch f.kind {
case FVar(_, AccNormal | AccNo):