Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/propertyInCompanionOfEnum.fir.kt
T
Simon Ogorodnik 2a16fe1d0f FIR: Fix overloading by type-arguments
In K1, upper bound violated causes candidate to have lower applicability
due to constraint errors, in K2 however constraint errors has to be
reported explicitly
2022-08-04 22:56:08 +02:00

41 lines
837 B
Kotlin
Vendored

// !CHECK_TYPE
// SKIP_TXT
// FILE: test.kt
package test
enum class E {
Entry;
companion object {
val Entry = ""
val NotEntry = ""
}
}
// FILE: main.kt
import test.E.Entry
import test.E.Companion as W
import test.E as U
import test.E
fun foo() {
E.Entry checkType { _<E>() }
E.Entry checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
E.Companion.Entry checkType { _<String>() }
E.NotEntry checkType { _<String>() }
Entry checkType { _<E>() }
W.Entry checkType { _<String>() }
}
// FILE: Aliased.kt
import test.E as U
fun bar() {
U.Entry checkType { _<<!UNRESOLVED_REFERENCE!>E<!>>() }
U.Entry checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
U.Companion.Entry checkType { _<String>() }
U.NotEntry checkType { _<String>() }
}