You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the initialization macro addGlobalMetadata("", "@:nativeGen") with haxe 4.3.0-rc.1 and target cs, I get the following errors
~/haxe/versions/779b005/std/cs/_std/Type.hx:33: lines 33-43 : Only flat enums may be @:nativeGen
~/haxe/versions/779b005/std/haxe/CallStack.hx:28: lines 28-34 : Only flat enums may be @:nativeGen
~/haxe/versions/779b005/std/haxe/io/Error.hx:31: lines 31-43 : Only flat enums may be @:nativeGen
If the errors can make sense when @:nativeGen is put by hand on a non-flat enum, I think that when the annotation is put by addGlobalMetadata, the compiler should be more lenient because the user has no way to avoid the error.
The text was updated successfully, but these errors were encountered:
This is not a matter of leniency, you're adding a metadata to everything and some things can't deal with it. The solution is to not add that metadata to everything. In this particular case, it's very likely that @:nativeGen is going to cause other problems anyway. What problem are you trying to solve here?
The problem is that the classes generated by Haxe extend HxObject in order to speed up reflection.
Since in my project I make only a limited use of reflection, I’d like to get rid of HxObject and the overridden methods like __hx_invokeField that pollute every class.
And annotating every class is too awkward, so I want to apply nativeGen automatically.
By the way I tried the targets jvm, python and js, and they don’t raise any errors.
When I use the initialization macro addGlobalMetadata("", "@:nativeGen") with haxe 4.3.0-rc.1 and target cs, I get the following errors
If the errors can make sense when @:nativeGen is put by hand on a non-flat enum, I think that when the annotation is put by addGlobalMetadata, the compiler should be more lenient because the user has no way to avoid the error.
The text was updated successfully, but these errors were encountered: