-
-
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
[php] no arrayAccess in php.NativeStructArray #8893
Comments
It is supposed to be used for externs arguments just to provide type safety for options declarations. |
Yes. typedef ClipListRequest = ArrayS<{
?id:String,
?name:String,
login:String
}>;
extern public function getcliplist(req:ClipListRequest):ClipListResponse; Then I like to call it like thiis: function getClip(id:Int, ?name:String) {
var req:ClipListRequest = {
login: "login"
}
if (name != null && id == 0) req["name"] = name;
else req["id"] = id;
var res = F.getcliplist(req);
} Adding: @:arrayAccess
inline function get<V>(key:String):V return this[key];
@:arrayAccess
inline function set<V>(key:String, val:V):V return this[key] = val; to |
Ideally I'd like to implement a proper typed field access to |
I see. Thanks for adding it. |
php.NativeStructArray
proves really quite useful for defining types of function parameters in extern php functions. Is there any reason why it's missingarrayAccess
(opposed tophp.nativeAssocArray
)?The text was updated successfully, but these errors were encountered: