KTIJ-26057 [AA] Ignore implicit receivers scope when dealing with types in reference shortener
Implicit receivers generally do not affect the resolution of types. However, they generate scopes which might contain undesirable classifiers, which can confuse reference shortener. Dropping all the implicit receivers when dealing with type references allows completely avoid such undesirable scopes instead of filtering them by `instanceof` checks. Also, temporary move `hasTypeParameterFromParent` check higher to the `findClassifierElementsToShorten`, because ATM we don't know how to properly decide whether to shorten the fully-qualified inner types with implicit parameters or not (see KTIJ-26072). ^KTIJ-26057 Fixed
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class Outer<T> {
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
fun <T> Outer<T>.test(p: <expr>Outer<T>.Inner</expr>) {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: Outer<T>.Inner
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class Outer<T> {
|
||||
class Nested
|
||||
}
|
||||
|
||||
fun <T> Outer<T>.test(p: <expr>Outer.Nested</expr>) {}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
Before shortening: Outer.Nested
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] Outer.Nested
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] Outer.Nested
|
||||
Reference in New Issue
Block a user