How objects with fields which are haxe keywords should be defined?

For instance how define such objects {default: true} or {in: true}?
Is it possible to give an alias for a typedef field?

I would use Reflection to do this

@:native (on extern types) can help: Try Haxe !

Thanks. But Dynamic is not very elegant solution. What if you need define the object {field1: Bool, field2: Bool,..., fieldN: Bool, default: Bool}?

Thanks for reply. But the code compiles to var o = new MyType(true,false);, but I need output like this var o = {default: true, in: false}

Is something like this will help?

Use double quotes for such fields: {"default":true, "in": false}

Yep, using of abstract can solve this issue. Thank you.

1 Like

FWIW, this proposal, once implemented should address this nicely.