Files
Roman Golyshev 99c7fab401 KT-59732 [FIR] Adjust test data for the absence of unresolved imports
Now there are no real unresolved imports - all imports are considered
resolved starting from the IMPORTS phase and until they are proven
otherwise in the checkers.

Because of that, some `UNRESOLVED_REFERENCE` diagnostics are gone -
in the cases when such references were actually resolved through
those unsupported imports.

The compilation of incorrect files should not be affected by this,
the checkers would still prevent the compilation of the files with
incorrect imports.
But now the references to the declarations from such imports no longer
will be highlighted as unresolved references.
2023-12-04 16:51:46 +00:00

102 lines
1.6 KiB
Kotlin
Vendored

// FILE:a.kt
package a
import b.B //class
import b.foo //function
import b.ext //extension function
import b.value //property
import b.C.Companion.bar //function from companion object
import b.C.Companion.cValue //property from companion object
import b.<!UNRESOLVED_IMPORT!>constant<!>.fff //function from val
import b.<!UNRESOLVED_IMPORT!>constant<!>.dValue //property from val
import b.constant
import b.E.Companion.f //val from companion object
import <!UNRESOLVED_IMPORT!>smth<!>.illegal
import b.C.<!UNRESOLVED_IMPORT!>smth<!>.illegal
import b.<!UNRESOLVED_IMPORT!>bar<!>.smth
import b.<!UNRESOLVED_IMPORT!>bar<!>.*
import b.<!UNRESOLVED_IMPORT!>unr<!>.unr.unr
import <!UNRESOLVED_IMPORT!>unr<!>.unr.unr
fun test(arg: B) {
foo(value)
arg.ext()
bar()
foo(cValue)
<!UNRESOLVED_REFERENCE!>fff<!>(<!UNRESOLVED_REFERENCE!>dValue<!>)
constant.fff(constant.dValue)
f.f()
}
// FILE:b.kt
package b
class B() {}
fun foo(i: Int) = i
fun B.ext() {}
val value = 0
class C() {
companion object {
fun bar() {}
val cValue = 1
}
}
class D() {
fun fff(s: String) = s
val dValue = "w"
}
val constant = D()
class E() {
companion object {
val f = F()
}
}
class F() {
fun f() {}
}
fun bar() {}
//FILE:c.kt
package c
import c.<!CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON!>C<!>.*
object C {
fun f() {
}
val i = 348
}
fun foo() {
if (i == 3) f()
}
//FILE:d.kt
package d
import d.A.Companion.B
import d.A.Companion.C
val b : B = B()
val c : B = C
class A() {
companion object {
open class B() {}
object C : B() {}
}
}