tink_macro icon indicating copy to clipboard operation
tink_macro copied to clipboard

Exprs.eval and stored typed expressions does not work for Haxe 4.3 +

Open back2dos opened this issue 3 years ago • 2 comments

See tests.

back2dos avatar Jul 06 '21 17:07 back2dos

Is this why my build macro is giving 'build failure' in Haxe 4.3?

import haxe.macro.Context;
import haxe.macro.Expr;

using StringTools;

class EnumBuilder {
        macro static public function build(types:ExprOf<Map<Int, String>>):Array<Field> {
                var t:Map<Int, String> = tink.macro.Exprs.eval(types);
                var fields = Context.getBuildFields()
                for (i => name in t) {
                        fields.push({
                                name: name,
                                doc: null,
                                meta: [],
                                access: [APublic],
                                kind: FVar(null, macro $v{i}),
                                pos: Context.currentPos(),
                        });
                }
                return fields;
        }

PaulPatat avatar Nov 04 '23 16:11 PaulPatat

Hard to know for sure without more context, but yes, it's a possible cause.

back2dos avatar Dec 08 '23 13:12 back2dos