-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Support Rest on non-extern methods too #3260
Conversation
@ncannasse: Any objections to merging this? It works just like in AS3 where you get an array with the excess arguments. |
Can we make it so that we get a |
I still don't understand how this is even relevant to native representations. |
I wonder if we need to add tests for extern Rest now that we have tests for non-extern Rest :-) |
I meant that it would be nice that |
But then you would generate the extern-like call anyway without any array initialization, so I still don't see the point. |
I'm not sure I understand - at least on Java (and IIRC on C# as well), you actually use the rest parameters as a native array, so they would be typed correctly when you declare a new Rest parameters function |
That's getting too complicated for me again so let's forget about it for now. |
The idea is good, let's not give up so quickly and wait for @ncannasse to say something 😉 |
I agree with nadako. It was just an idea, I can probably figure something out from the Java/C# side so it generates the native signature correctly |
It's not worth it though because all it does is save you typing |
Allowing to override Rest functions would be a nice reason to allow this |
If we're talking java/cs, it can do more that that, considering target interoperability. For example it takes more than just After all, abstracts were designed to hide native stuff, so I even think it's okay to have different undelying types for different platforms (Array for flash/js, haxe.ds.Vector for Java/C#). |
That's what I meant when I said to change the underlying type to Vector. Sorry I wasn't clear |
Let's reopen this. I think it's worth - at least to have a better discussion about it. |
ping @ncannasse :) |
There's a bit of a design issue between a "native extern" where you want the rest parameters to be passed as-it and the "haxe extern" that needs to be passed as an Array. We tend to compile the whole Haxe code at once, but this feature would clearly break the ability to use haxe externs. Any idea ? |
Good point |
What are "Haxe externs" actually used for? |
For example : sharing a Haxe/JS library among several projects ? |
We could generate Rest as |
Let's not introduce this for 3.2 and think some day later. I personally don't find rest args very useful and i can do that with macro anyway. |
OTOH, the native method override argument is still valid |
if cl_extern || is_override ? |
At some point we'll have to deal with these kind of differences ( |
I need an issue ID to write tests.