-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
Forwarded fields lose information about abstract type. #6639
Comments
As I mentioned before, this is not related to Lines 1536 to 1537 in 2ab958e
I see two ways of fixing this:
|
I think |
I don't really understand why you guys expect this to resolve to the abstract. The whole idea of |
I think it's certainly fine if |
I think this can happen with inlining too because it's a very similar situation. We can insert a cast, but then we might run into problems with |
What about not touching types and adding casts and introduce |
I don't see the point given that inlining already generates these casts. This would just introduce another special case you have to deal with. |
Here is my motivation: @:forward
abstract NativeStructArray<T:{}>(T) {<...>} And then in genphp i generate all field access to |
Well, one way would be to use Another one might be something like: @:native("array")
extern class ProcStatus {
var command(default, null):String;
var pid(default, null):Int;
// ...
} Or you can use some explicit metadata (yay, more metadata \o/) or a marker interface or something. |
Ye, i'm trying to avoid unnecessary metas ) |
Can we have this for Haxe4? |
This was fixed in 9e7a820, the typed AST now has a cast:
|
-D dump=ast
Add this to any generator:
Expected output:
Current output:
That means generator cannot recognize
NativeStructArray
behindAnonOptions
inoptions.hostt
expression.The text was updated successfully, but these errors were encountered: