-
Notifications
You must be signed in to change notification settings - Fork 256
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
Varargs support isn't implemented properly #555
Comments
If you do: double[] doublesPrim = {1.0, 2.0};
System.out.println(Arrays.asList(doublesPrim)); you get:
as the type is List<double[]> instead of List. See also: https://stackoverflow.com/a/2926653. As the conversion of autoboxed types vs primitives is subtle, I'm not sure that Jnius can entirely replicate the semantics. Interestingly,
which I would have expected to work. So there might be more need for autoboxing. I think populate_args() needs to know if its dealing with a varargs. |
@hx2A as the most recent amazing varargs expert, could you add a few cents here? Given that Java has differing varargs behaviour between double[] and Double[] we need to think carefully about what the correct resolution should be. |
I tried debugging the code and I don't see what to do here. The signature of the I do see that this works fine:
This might have less to do with varargs and more to do with the ambiguity of a generic function. |
Closing because there doesn't seem to be a path to resolving this. |
In java:
With jnius:
which is wrong
Additionally, varargs doesn't work with autoboxing: #509
I checked out JPype out and it's working there properly so switched to using JPype :)
The text was updated successfully, but these errors were encountered: