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

Projects
None yet
2 participants
@pvojtechovsky
Collaborator

pvojtechovsky commented Apr 26, 2017

Fixes #1218

@monperrus

This comment has been minimized.

Show comment
Hide comment
@monperrus

monperrus Apr 26, 2017

Collaborator

awesome! could you add a test case?

Collaborator

monperrus commented Apr 26, 2017

awesome! could you add a test case?

@pvojtechovsky

This comment has been minimized.

Show comment
Hide comment
@pvojtechovsky

pvojtechovsky Apr 26, 2017

Collaborator

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.

Collaborator

pvojtechovsky commented Apr 26, 2017

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

This comment has been minimized.

Show comment
Hide comment
@pvojtechovsky

pvojtechovsky Apr 27, 2017

Collaborator

Test added

Collaborator

pvojtechovsky commented Apr 27, 2017

Test added

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

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 81.424%
Details
pull_request-INRIA-spoon-master-docker /tmp/tmp_ru9nblc
Details
pull_request-INRIA-spoon-master-revapi Revapi: No change detected.
Details
@monperrus

This comment has been minimized.

Show comment
Hide comment
@monperrus

monperrus Apr 27, 2017

Collaborator

thanks a lot Pavel.

Collaborator

monperrus commented Apr 27, 2017

thanks a lot Pavel.

@pvojtechovsky pvojtechovsky deleted the pvojtechovsky:fixActTypeArgsResolving branch May 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment