KTIJ-28167 [AA] Support SAM constructors in KtFirReferenceShortener
Utilize `FirSamResolver` to obtain the potential SAM constructor from the classifier Also, accept K2_SYNTHETIC_RESOLVED in the `resolveUnqualifiedAccess`, since this is the kind of resolve success which corresponds to the SAM constructor call resolution ^KTIJ-28167 Fixed
This commit is contained in:
committed by
Space Team
parent
e561de8a22
commit
df8c6c694a
+13
@@ -0,0 +1,13 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
val handler = <expr>dependency.Outer.NestedSAM {}</expr>
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
class Outer {
|
||||
fun interface NestedSAM {
|
||||
fun method()
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
Before shortening: dependency.Outer.NestedSAM {}
|
||||
with default settings:
|
||||
[qualifier] dependency.Outer
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] dependency.Outer.NestedSAM {}
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] dependency.Outer.NestedSAM {}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
fun interface KotlinSAM {
|
||||
fun method()
|
||||
}
|
||||
|
||||
val handler = <expr>test.KotlinSAM {}</expr>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
Before shortening: test.KotlinSAM {}
|
||||
with default settings:
|
||||
[qualifier] test.KotlinSAM {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] test.KotlinSAM {}
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] test.KotlinSAM {}
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] test.KotlinSAM {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
val handler = <expr>test.JavaSAM {}</expr>
|
||||
|
||||
// FILE: test/JavaSAM.java
|
||||
package test;
|
||||
|
||||
public interface JavaSAM {
|
||||
void method();
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
Before shortening: test.JavaSAM {}
|
||||
with default settings:
|
||||
[qualifier] test.JavaSAM {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] test.JavaSAM {}
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] test.JavaSAM {}
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] test.JavaSAM {}
|
||||
Reference in New Issue
Block a user