Skip to content
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

non-intuitive overloaded varargs matching #3279

Closed
kares opened this issue Aug 24, 2015 · 3 comments
Closed

non-intuitive overloaded varargs matching #3279

kares opened this issue Aug 24, 2015 · 3 comments

Comments

@kares
Copy link
Member

kares commented Aug 24, 2015

assuming 2 methods (Object... args) and (String a, Object... args)

a call('str') won't match (String a, Object... args) but simply uses the generic one

@kares
Copy link
Member Author

kares commented Aug 24, 2015

... not sure if it's a good idea to fix these on JRuby 1.7.x (assuming not due compatibility) ?

@kares kares closed this as completed Aug 24, 2015
@kares kares reopened this Aug 24, 2015
@headius
Copy link
Member

headius commented Sep 4, 2015

I'd guess that call('str'.to_java) invokes the right one, but I agree we could do a better job when we know we're turning an argument into a java.lang.String or other basic type.

@kares kares self-assigned this Sep 14, 2015
@kares
Copy link
Member Author

kares commented Sep 15, 2015

it's not an issue with type matching (call('str'.to_java) does not invoke the right one) but of a varargs processing as it's only considered a suitable match for arities where the var-arg parameter receives an arg...

@kares kares added this to the JRuby 9.0.2.0 milestone Sep 15, 2015
kares added a commit to kares/jruby that referenced this issue Sep 15, 2015
… receives no arg

`method(String, Object...)` will now be considered with a `method('foo')` call

fixes jruby#3279
@kares kares closed this as completed in e85df14 Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants