Repository navigation
Feature/1782 paramaterized enclosing class - #1746
Draft
StefanGraeber wants to merge 2 commits into
Draft
StefanGraeber wants to merge 2 commits into
StefanGraeber wants to merge 2 commits into
Conversation
…es before other completions
When parsing type annotations on types which anner INNER_TYPEs of other classes, it is required to know the enclosing class for a correct resolution.
Since type annotation parsing will happen as early as `completeTypeParameters` and inner classes can be referenced as bounds for type parameters of the outer class, all inner classes must know their onclosing class.
The same problem arises for any other usage of the inner class in the outer, e.g.
```
class Outer {
private Outer.@TypeUseAnnotation Inner someField;
class Inner {}
}
```
requires in `completeMembers` for type annotation resolution that the `Outer.Inner` knows its enclosing class.
Since it is not possible to reference classes declared inside a code unit, this resolution step may be incomplete when resolving type annotations.
The same list is iterated twice to avoid a behavior change.
The frist list changes the return value of `classes.getAllWithOuterClassesSortedBeforeInnerClasses()` to include more classes.
Calling that method twice causes the tests `creates_new_stub_type_variables_for_type_variables_of_enclosing_classes_that_are_out_of_context` in `ClassFileImporterGenericClassesTest` and `ClassFileImporterGenericMethodSignaturesTest` to fail
Signed-off-by: Stefan Gräber <stefan.graeber@tngtech.com>
…dType.getEnclosingType If an inner class is enclosed by a class with generic arguments, it is possible to specify type arguments to the outer class like `Outer<T>.Inner`. In these cases, the Inner class must be represented by JavaParameterizedType even though it doesn't have a type parameter itself. Signed-off-by: Stefan Gräber <stefan.graeber@tngtech.com>
This branch has not been deployed
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.
No description provided.