[FIR] Report INVISIBLE_REFERENCE on the first unresolved qualifier

#KT-61719 Fixed
This commit is contained in:
Kirill Rakhman
2023-09-08 14:34:12 +02:00
committed by Space Team
parent 2127b2ce68
commit 2566dabfce
24 changed files with 67 additions and 118 deletions
@@ -1,14 +0,0 @@
package p
import p.Foo.Nested
open class Foo {
protected class Nested
}
class Bar: Foo() {
protected fun foo(): Nested? = null
}
private fun foo(): <!INVISIBLE_REFERENCE!>Nested<!>? = null
private fun bar(): <!INVISIBLE_REFERENCE!>p.Foo.Nested<!>? = null
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
package p
import p.Foo.Nested
@@ -1,7 +1,7 @@
// !CHECK_TYPE
@<!INVISIBLE_REFERENCE!>kotlin.internal.<!INVISIBLE_REFERENCE!>InlineOnly<!><!>
@kotlin.internal.<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>InlineOnly<!>
public inline fun <C, R> C.ifEmpty(f: () -> R): R where C : Collection<*>, C : R = if (isEmpty()) f() else this
public fun <T> listOf(t: T): List<T> = TODO()
@@ -1,32 +0,0 @@
// FILE: a/M.java
package a;
public class M {
public class Inner {
}
public static class Nested {
}
private class PrInner {
}
private static class PrNested {
}
}
// FILE: b.kt
package b
fun f() {
val c1: a.M.Inner
val c2: a.M.Nested
val c3: <!INVISIBLE_REFERENCE!>a.M.PrInner<!>
val c4: <!INVISIBLE_REFERENCE!>a.M.PrNested<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: a/M.java
package a;
@@ -1,19 +0,0 @@
// FILE: p/Foo.java
package p;
public class Foo {
protected static class Nested {}
}
// FILE: foo.kt
package a
import p.Foo
import p.Foo.Nested
class Bar : Foo() {
protected fun foo(): Nested? = null
}
private fun foo(): <!INVISIBLE_REFERENCE!>Nested<!>? = null
private fun bar(): <!INVISIBLE_REFERENCE!>p.Foo.Nested<!>? = null
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: p/Foo.java
package p;
@@ -16,4 +16,4 @@ class Bar : <!EXPOSED_SUPER_CLASS, INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>Foo
}
private fun foo(): <!INVISIBLE_REFERENCE!>Nested<!>? = null
private fun bar(): <!INVISIBLE_REFERENCE!>p.Foo.Nested<!>? = null
private fun bar(): p.<!INVISIBLE_REFERENCE!>Foo<!>.Nested? = null
@@ -30,7 +30,7 @@ fun test() {
<!INVISIBLE_REFERENCE!>foo<!>()
val u : <!INVISIBLE_REFERENCE!>A<!> = <!INVISIBLE_REFERENCE!>A<!>()
val a : <!INVISIBLE_REFERENCE!>java.util.Arrays.ArrayList<Int><!>;
val a : java.util.Arrays.<!INVISIBLE_REFERENCE!>ArrayList<!><Int>;
val po = <!INVISIBLE_REFERENCE!>PO<!>
}
@@ -30,5 +30,5 @@ fun baz() {
a.A3("") checkType { _<String>() }
val x: <!INVISIBLE_REFERENCE!>a.A2<!> = B("") // A2 is unresolved because it's private in file, OK
val x: a.<!INVISIBLE_REFERENCE!>A2<!> = B("") // A2 is unresolved because it's private in file, OK
}
@@ -6,7 +6,7 @@ private class C {
private typealias TA = C
private val test1: <!INVISIBLE_REFERENCE!>C<!> = <!INVISIBLE_REFERENCE!>C<!>()
private val test1co: <!INVISIBLE_REFERENCE!>C.Companion<!> = <!INITIALIZER_TYPE_MISMATCH, INVISIBLE_REFERENCE, NO_COMPANION_OBJECT!>C<!>
private val test1co: <!INVISIBLE_REFERENCE!>C<!>.Companion = <!INITIALIZER_TYPE_MISMATCH, INVISIBLE_REFERENCE, NO_COMPANION_OBJECT!>C<!>
private val test2: <!INVISIBLE_REFERENCE!>TA<!> = <!INVISIBLE_REFERENCE!>TA<!>()
private val test2co = <!INVISIBLE_REFERENCE!>TA<!>
@@ -18,7 +18,7 @@ private val test2co = TA
// FILE: file2.kt
private val test1: <!INVISIBLE_REFERENCE!>C<!> = <!INVISIBLE_REFERENCE!>C<!>()
private val test1co: <!INVISIBLE_REFERENCE!>C.Companion<!> = <!INVISIBLE_REFERENCE!>C<!>
private val test1co: <!INVISIBLE_REFERENCE!>C<!>.Companion = <!INVISIBLE_REFERENCE!>C<!>
private val test2: <!INVISIBLE_REFERENCE!>TA<!> = <!INVISIBLE_REFERENCE!>TA<!>()
private val test2co = <!INVISIBLE_REFERENCE!>TA<!>
@@ -8,6 +8,6 @@ private class Private {
import <!INVISIBLE_REFERENCE!>Private<!>.Public
private fun test_1(x: <!INVISIBLE_REFERENCE!>Private.Public<!>, y: <!INVISIBLE_REFERENCE!>Public<!>) {
private fun test_1(x: <!INVISIBLE_REFERENCE!>Private<!>.Public, y: <!INVISIBLE_REFERENCE!>Public<!>) {
}
@@ -1,15 +0,0 @@
// SKIP_TXT
// FILE: a.kt
package p
class FilteringSequence
// FILE: b.kt
package kotlin.sequences
import p.*
interface I {
val v1: FilteringSequence
val <!EXPOSED_PROPERTY_TYPE!>v2<!>: <!INVISIBLE_REFERENCE!>IndexingSequence<String><!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// SKIP_TXT
// FILE: a.kt
package p