echoes icon indicating copy to clipboard operation
echoes copied to clipboard

Support `final` properties in entity templates

Open ProfDiesel opened this issue 9 months ago • 1 comments

Compilation fix for Haxe 5.

ProfDiesel avatar Mar 23 '25 20:03 ProfDiesel

I'm worried that this would be misleading. Entity templates are just syntax sugar, and can't prevent a component from being overwritten. Even if we declare the property as (get, never) and don't include a setter, the user can still modify the component by calling add().

If it's just meant as a suggestion or reminder not to modify the component, that's fair, but I'd want to go about that in a less-misleading way.

If you got an error when you typed final and wanted to fix the error, we could do a quick access.remove(AFinal). But again, final is misleading, so perhaps it should remain an error.

player-03 avatar Mar 24 '25 05:03 player-03

I've added an error message to the Haxe 4 version, for consistency. If you'd like to make the case that we should support final components, get back to me and I can reopen this.

player-03 avatar Jun 08 '25 22:06 player-03