Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.fir.kt
T
Tianyu Geng 761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +03:00

26 lines
545 B
Kotlin
Vendored

// !CHECK_TYPE
import kotlin.reflect.*
class A {
val foo: Int = 42
var bar: String = ""
}
fun test() {
val p = A::foo
checkSubtype<KProperty1<A, Int>>(p)
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KMutableProperty1<A, Int>>(p)
checkSubtype<Int>(p.get(A()))
p.get(<!NO_VALUE_FOR_PARAMETER!>)<!>
p.<!UNRESOLVED_REFERENCE!>set<!>(A(), 239)
val q = A::bar
checkSubtype<KProperty1<A, String>>(q)
checkSubtype<KMutableProperty1<A, String>>(q)
checkSubtype<String>(q.get(A()))
q.set(A(), "q")
}