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

fix actual type arguments resolving #1273

Merged
merged 2 commits into from
Apr 27, 2017

Conversation

pvojtechovsky
Copy link
Collaborator

Fixes #1218

@monperrus
Copy link
Collaborator

awesome! could you add a test case?

@pvojtechovsky
Copy link
Collaborator Author

I will probably have time tomorrow evening for that.
The problem was that ClassTypingContext of ForwardingNavigableMap$StandardDescendingMap was asked to adapt parameter <K> of superclass Maps.DescendingMap<K, V> of StandardDescendingMap.
There was error in algorithm that typed parameters was searched only in current type hierarchy and was not search in type hierarchy of enclosing (declaring) class. The test case should be something like

class A<T> {
 class B extends List<T> {}
}

where

new ClassTypingContext(classB).adaptType(classB.getSuperClass().getActualTypeArguments().get(0))

failed before, but should return <T> of class A.

@pvojtechovsky
Copy link
Collaborator Author

Test added

@monperrus monperrus merged commit 4c0ac32 into INRIA:master Apr 27, 2017
@monperrus
Copy link
Collaborator

thanks a lot Pavel.

@pvojtechovsky pvojtechovsky deleted the fixActTypeArgsResolving branch May 3, 2017 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants