Closed kevinresol closed 4 years ago
Perhaps genes should generate a real underlying variable, e.g.:
static get inst() {
return this.get_inst()
}
static get_inst() {
if (Main.__genes__inst == null) {
Main.__genes__inst = "foo";
};
return Main.__genes__inst;
}
Oh, that's interesting. I thought this case was only possible with @:isVar, where the native getter would not be generated. Maybe it's different for static properties, I'll have a look.
iirc @:isVar
is only useful for (get/never, set/never)
because null
accessor means the var can be accessed within the class, so there would be a physical var.
I only generate the native setters/getters for improved interop with js. But as far as generation of code goes I'd like to stay close to what haxe does as maybe some day I can rip out the ExprEmitter for JSGenApi expr/value (which for me depends on haxefoundation/haxe#8625)
genes generated:
which overflows because of the mutual recursion