-
-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid identifiers from build macros make it to native compilation #5002
Comments
I'm not sure if we should detect that, you could cause the same problems using |
It's not like there's a valid use case for this though, right? It seems strange that macro-generated identifiers wouldn't go through the same checks as regular ones. Not checking this leads to a lot of target-specific, cryptic errors that could be detected much earlier. |
I still think this should be filed under "don't do stupid things". Otherwise we would have to add "is valid field name" functions for every target, and then we would probably need the same for type names, var names and whatnot. So yeah, don't do stupid things. :) |
Meh, I really dislike that you can get failures during native compilation (or even at runtime on some targets) because of this...
Huh? Why not just require it to be a valid Haxe identifier as usual- how is that target-specific? |
Does it make sense to do this check during decoding in |
I'm still not convinced this should be checked at all, but if anything this should be handled during typing. Maybe all the places where we check for that leading |
Well.. to me it seems like a pretty big hole in the type safety of the macro API. In a way it's almost as if identifiers are dynamically typed. Effectively this makes macro-generated code less type safe than regular Haxe code, which is a strange disparity. Edit: maybe "type" safe is the wrong term here.. anyway you get the point. :) |
Fails during cpp compilation:
Cs compilation:
...and probably every other target with a native compilation step.
Not a regression.
The text was updated successfully, but these errors were encountered: