-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
[PHP] Would it be possible to allow inlined vars with untyped code? #4770
Comments
I'm not sure if that's feasible with the current representation of native code. This is treated like a call which is not a constant expression, which generally makes sense. I have multiple issues with these constructs and would like to see it change, but I'm not quite sure how to go on about it. |
There's no way to trick the compiler into treating this as a constant somehow with a macro, is there? |
Unfortunately I see now way to support this without making internal structural changes. We can look at it again for Haxe 4 (#4684), but for the time being I might as well close the issue. Sorry! |
Note that this was only supposed to be a workaround for using global PHP constants. Since #4925 the example above can be written as:
A bit verbose maybe, but works. No Also externs for global functions can be defined in a similar way now, which eliminates the need for |
It would be quite nice if something like this was allowed for dealing with PHP constants:
public static inline var phpVersion:String = untyped __php__("PHP_VERSION");
Right now you have to do:
which is OK, but doesn't work in
@:enum abstract
e.g.:You have to lookup the actual integer vaalues there.
The text was updated successfully, but these errors were encountered: