-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add symbol solver support for variadic parameters given zero or more than one argument #2675
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
Conversation
When I look at PRs I try to run the tests on master before then also apply the fixes. It seems that the tests all pass even without making the changes to @hfreeb - it's an area I don't fully understand what's needed (or not) -- could you take another look and advise please? 😄 |
I've removed the comments and added a new test case which does require the changes to MethodResolutionLogic. Also, I fixed the caveat I mentioned in the PR text, so I believe this will now work as expected for a vararg of arrays. |
…blic static final variables to Position.java from Node.java (deprecated them in Node.java with a message), deprecated the static method for pos in favour of calling the constructor directly,
…e where we have an empty vararg
…empts to access entries in an empty list;
I got a bit carried away in trying to understand what was going on, and added in a bunch of comments / renamed variables to be more explicit etc., so hopefully it's also now a bit more self-documenting. Really grateful to @hfreeb for getting this started! This is your PR though -- please do take a look and make any changes you think are appropriate! |
The changes look good to me, the comments should definitely help the next person trying to figure all this out! |
Cool :) I'll merge it if you're happy to give the okay to do so! |
Yep, sounds good to me! |
Currently, varargs in the symbol solver seem to only really be supported when the number of parameters still equals the number of arguments. This PR fixes that.
One caveat is that I don't believe a vararg of arrays will work properly since if an array is the only argument for the variadic parameter, then it is compared with the type of the variadic parameter itself, and not its component type (I found this assumption in other places too).