Define typedef field named 'class'

I want to use this for defining html element types (part of a virtual dom solution) but as class is a reserved word I am not able to do this:

typedef Attributes =
{
    id: String,
    style: String,
    class: String
}

The name is perfectly valid in JavaScript (as far as I am aware of): so is there a way to trick the compiler into accepting this?

Not really =/ (well there’s always some tricks with abstracts or @:structInit interfaces, but they’re far from perfect)

See @:native metadata on typedef fields · Issue #5105 · HaxeFoundation/haxe · GitHub and Permit json syntax more generally for anon-types. by deltaluca · Pull Request #2185 · HaxeFoundation/haxe · GitHub

Thanks for the quick reply: I think we will work around the problem for now :slight_smile: