GROOVY-8252: AIOOBE in combination of ncurry and rcurry#612
Closed
paulk-asert wants to merge 1 commit intoapache:masterfrom
Closed
GROOVY-8252: AIOOBE in combination of ncurry and rcurry#612paulk-asert wants to merge 1 commit intoapache:masterfrom
paulk-asert wants to merge 1 commit intoapache:masterfrom
Conversation
1fc4449 to
7419be6
Compare
asfgit
pushed a commit
that referenced
this pull request
Oct 9, 2017
asfgit
pushed a commit
that referenced
this pull request
Oct 9, 2017
asfgit
pushed a commit
that referenced
this pull request
Oct 9, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because of the way method selection works with overloaded methods, the position of params when applying
rcurryis calculated lazily. E.g. for a method closure for thefoomethod, if there are two foo variantsfoo(String, String)andfoo(String, String, String), then right currying a single string parameter and supplying a single string argument will result in thefoo(String, String)method being called but supplying two string arguments will call the 3 param variant to be called.It doesn't make sense to do this for
ncurrysince a specific index is being supplied. I have clarified the documentation and implementation to capture those aspects of the current design and introduced some checking to avoid the AIOOBE when usingncurrywhen those assumptions are violated and instead throw anIllegalArgumentException.