FIR checker: fix REFERENCE_BY_QUALIFIED positioning strategy to consider callable reference
This commit is contained in:
committed by
Mikhail Glukhikh
parent
8d8ed4cc18
commit
bfc7eb7bab
Vendored
+5
-5
@@ -6,10 +6,10 @@ public interface J {
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun f1(x: Int?): Any = <!UNRESOLVED_REFERENCE!>x::hashCode<!>
|
||||
fun <T> f2(t: T): Any = <!UNRESOLVED_REFERENCE!>t::hashCode<!>
|
||||
fun <S : String?> f3(s: S): Any = <!UNRESOLVED_REFERENCE!>s::hashCode<!>
|
||||
fun <U : Any> f4(u: U?): Any = <!UNRESOLVED_REFERENCE!>u::hashCode<!>
|
||||
fun f5(c: List<*>): Any = <!UNRESOLVED_REFERENCE!>c[0]::hashCode<!>
|
||||
fun f1(x: Int?): Any = x::<!UNRESOLVED_REFERENCE!>hashCode<!>
|
||||
fun <T> f2(t: T): Any = t::<!UNRESOLVED_REFERENCE!>hashCode<!>
|
||||
fun <S : String?> f3(s: S): Any = s::<!UNRESOLVED_REFERENCE!>hashCode<!>
|
||||
fun <U : Any> f4(u: U?): Any = u::<!UNRESOLVED_REFERENCE!>hashCode<!>
|
||||
fun f5(c: List<*>): Any = c[0]::<!UNRESOLVED_REFERENCE!>hashCode<!>
|
||||
|
||||
fun f6(j: J): Any = j.platformString()::hashCode
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
fun test() = <!UNRESOLVED_REFERENCE!>("").<!UNRESOLVED_REFERENCE!>hashCode<!>::hashCode<!>
|
||||
fun test() = ("").<!UNRESOLVED_REFERENCE!>hashCode<!>::<!UNRESOLVED_REFERENCE!>hashCode<!>
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
class Outer {
|
||||
class Nested
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
fun test() {
|
||||
Outer()::Inner
|
||||
<!UNRESOLVED_REFERENCE!>Outer()::Nested<!>
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
class Outer {
|
||||
class Nested
|
||||
inner class Inner
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
fun bar() {}
|
||||
fun f() = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Unresolved<!>()::bar<!>
|
||||
fun f() = <!UNRESOLVED_REFERENCE!>Unresolved<!>()::<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
}
|
||||
|
||||
val f: () -> Unit = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Unresolved<!>()::foo<!>
|
||||
val f: () -> Unit = <!UNRESOLVED_REFERENCE!>Unresolved<!>()::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
|
||||
compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.fir.kt
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
// FILE: A.java
|
||||
|
||||
public class A {
|
||||
public static void test() {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
enum class E { EN }
|
||||
|
||||
fun test() {
|
||||
<!UNRESOLVED_REFERENCE!>A()::test<!>
|
||||
<!UNRESOLVED_REFERENCE!>E.EN::valueOf<!>
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.java
|
||||
|
||||
public class A {
|
||||
|
||||
Vendored
+3
-3
@@ -18,9 +18,9 @@ class Test {
|
||||
val <T> List<T>.b: Int? get() = size
|
||||
|
||||
fun <T> List<T>.testCallable1(): () -> Unit = a<T>::foo
|
||||
fun <T> List<T>.testCallable2(): () -> Unit = <!UNRESOLVED_REFERENCE!>b?::foo<!>
|
||||
fun <T> List<T>.testCallable3(): () -> Unit = <!UNRESOLVED_REFERENCE!>b<T, Any>::foo<!>
|
||||
fun <T> List<T>.testCallable4(): () -> Unit = <!UNRESOLVED_REFERENCE!>b<T>?::foo<!>
|
||||
fun <T> List<T>.testCallable2(): () -> Unit = b?::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
fun <T> List<T>.testCallable3(): () -> Unit = b<T, Any>::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
fun <T> List<T>.testCallable4(): () -> Unit = b<T>?::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
|
||||
fun <T> List<T>.testClassLiteral1() = a<T>::class
|
||||
fun <T> List<T>.testClassLiteral2() = <!EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>b<!>?::class
|
||||
|
||||
Vendored
+1
-1
@@ -4,4 +4,4 @@ package test
|
||||
fun nullableFun(): Int? = null
|
||||
fun Int.foo() {}
|
||||
|
||||
val test1 = <!UNRESOLVED_REFERENCE!>nullableFun()?::foo<!>
|
||||
val test1 = nullableFun()?::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
|
||||
Reference in New Issue
Block a user