-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
@:native metadata on typedef fields #5105
Comments
Native only work on externs, |
I can confirm I have needed this on occasion. My workaround was to declare On Tue, Apr 12, 2016 at 11:37 AM, Valentin Lemière <[email protected]
|
Yeah that's what everyone does right now. I think @fponticelli or someone even has a macro builder for those. Related discussion: #2185 |
So to sum it up: can the @:native metadata for typedef fields be implemented in Haxe or not? I do think it has all its meaning as when writing and using externs, you often have to describe data structures used for the parameters of externs methods. We do not have more control over the names used for the fields of those structures than for the extern methods names... Thus the need of this feature for typedef fields as well... |
#2185 is a bit messy as it actually tries to address several issues in a single ticket... |
I looked into implementing this briefly and I think it can be supported, but requires some thought, so I'll make a Haxe Evolution proposal describing how it should work and we'll discuss it a bit. |
I am unassigning myself from this due to lack of interest. See #9433 and HaxeFoundation/haxe-evolution#32 for two possible solutions for this if anyone wants to push this forward. |
We need this at @innogames for a structure like this (note the typedef StackTraceFrame = {
abs_path:String,
lineno:Int,
in_app:Bool,
module:String,
filename:String,
function:String
} This structures goes throgugh |
I agree we need a solution. |
I've created a macro workaround if anyone is needing a solution before compiler changes: It converts a anon structure into an abstract with getters and setters to access the |
So is this in the works? What is the status? This will greatly reduce my frustration with the Lua target |
I'm trying to use the
@:native
metadata on a typedef field:But the
@:native
metadata doesn't seem to work on typedef fields... That would be very useful in js when interfacing with extern libs...The text was updated successfully, but these errors were encountered: