In a build macro, I want to create a ComplexType TAnonymous([fields...]) in which some of the fields are optional. But haxe.macro.Field doesn't have an opt parameter, and when I put TOptional(type) as a field object's type, the compiler says " Optional type not allowed here"
I also tried prefixing the name of a Field object with "?", to emulate the syntax
{?field:Type} which works in normal haxe type definitions.
When I did this, referencing my anonymous type's fields would cause a compiler error "{?field: Type } has no field field (Suggestion: ?field)" which is weird.
In a build macro, I want to create a ComplexType
TAnonymous([fields...])
in which some of the fields are optional. Buthaxe.macro.Field
doesn't have anopt
parameter, and when I putTOptional(type)
as a field object's type, the compiler says " Optional type not allowed here"I also tried prefixing the name of a Field object with "?", to emulate the syntax
{?field:Type}
which works in normal haxe type definitions.When I did this, referencing my anonymous type's fields would cause a compiler error "{?field: Type } has no field field (Suggestion: ?field)" which is weird.