Various little fixes.
This commit is contained in:
@@ -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({
|
||||
|
3
src/tink/macro/ConstParam.hx
Normal file
3
src/tink/macro/ConstParam.hx
Normal file
@@ -0,0 +1,3 @@
|
||||
package tink.macro;
|
||||
|
||||
class ConstParam<Const> {}
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user