[Analysis API] Ignore FirClassUseSiteMemberScope scopes in KtFirReferenceShortener
Those scopes always contain all nested classifiers, while only some of them are available without explicit import. There are other, more reliable scopes (like FirNestedClassifierScopeWithSubstitution) which are stricter about which classifiers they recognise as valid ^KTIJ-24684 Fixed ^KTIJ-24662 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: main.kt
|
||||
|
||||
interface MyInterface {
|
||||
class Nested
|
||||
}
|
||||
|
||||
class Foo : MyInterface {
|
||||
<expr>val prop: MyInterface.Nested = MyInterface.Nested()</expr>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
Before shortening: val prop: MyInterface.Nested = MyInterface.Nested()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// FILE: main.kt
|
||||
import MyInterface.Nested
|
||||
|
||||
interface MyInterface {
|
||||
class Nested
|
||||
}
|
||||
|
||||
class Foo : MyInterface {
|
||||
<expr>val prop: MyInterface.Nested = MyInterface.Nested()</expr>
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
Before shortening: val prop: MyInterface.Nested = MyInterface.Nested()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: main.kt
|
||||
open class MyBaseClass {
|
||||
class Nested
|
||||
}
|
||||
|
||||
class Foo : MyBaseClass() {
|
||||
<expr>val prop: MyBaseClass.Nested = MyBaseClass.Nested()</expr>
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
Before shortening: val prop: MyBaseClass.Nested = MyBaseClass.Nested()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] MyBaseClass.Nested
|
||||
[qualifier] MyBaseClass.Nested()
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] MyBaseClass.Nested
|
||||
[qualifier] MyBaseClass.Nested()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] MyBaseClass.Nested
|
||||
[qualifier] MyBaseClass.Nested()
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// FILE: main.kt
|
||||
interface MyInterface {
|
||||
class Nested
|
||||
|
||||
<expr>val prop: MyInterface.Nested get() = MyInterface.Nested()</expr>
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
Before shortening: val prop: MyInterface.Nested get() = MyInterface.Nested()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: main.kt
|
||||
interface MyInterface {
|
||||
class Nested
|
||||
}
|
||||
|
||||
fun MyInterface.foo() {
|
||||
<expr>val prop: MyInterface.Nested = MyInterface.Nested()</expr>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
Before shortening: val prop: MyInterface.Nested = MyInterface.Nested()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] MyInterface.Nested
|
||||
[qualifier] MyInterface.Nested()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: main.kt
|
||||
open class MyBaseClass {
|
||||
class Nested
|
||||
}
|
||||
|
||||
fun MyBaseClass.foo() {
|
||||
<expr>val prop: MyBaseClass.Nested = MyBaseClass.Nested()</expr>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
Before shortening: val prop: MyBaseClass.Nested = MyBaseClass.Nested()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] MyBaseClass.Nested
|
||||
[qualifier] MyBaseClass.Nested()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] MyBaseClass.Nested
|
||||
[qualifier] MyBaseClass.Nested()
|
||||
Reference in New Issue
Block a user