tink_macro
tink_macro copied to clipboard
The macro toolkit
I get errors but I don't know where to look The macro ```hx #if !macro macro function asComponent(fun:haxe.macro.Expr, ?options:{}) { // trace(fun); // var fExpr:Expr = toExpr(fun); return switch fun.expr...
TBH, I am not exactly sure where to report this. Repro case: https://github.com/kevinresol/haxe_issues/tree/tink_macro_34 `haxe build.hxml -v` will hang with: ``` ... Exiting macro tink.macro.Types.resolveDirectType Typing tink.pure._Vector.Vector_Impl_.fromIterable Typing tink.pure._Vector.Vector_Impl_._new Typing Main.data...
Basically this piece of code: https://github.com/haxetink/tink_json/blob/09c708c6cebfa47fd9165d9b6a380e077ff3f320/src/tink/json/macros/GenWriter.hx#L368-L379 For example for `tink.Annex` we have `.get(TheType)`, but `.get(TheType)` doesn't work, but we can `typedef TheIntType = TheType;` then `.get(TheIntType)`. This will be useful...
Probably will have to be a separate lib.
I think it is quite difficult to understand the behaviour just from the function name...
See https://github.com/haxetink/tink_unittest/issues/9#issuecomment-305165448
First, I have to wrap `using tink.MacroApi;` within `#if macro`, if my module has mixed macro and non-macro code. Otherwise it will complain something like `Class has no field makeExpr`....