Files
kotlin-fork/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

28 lines
777 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
class A<R>() {
operator fun <T> getValue(t: Any?, p: KProperty<*>): T = null!!
operator fun <T> setValue(t: Any?, p: KProperty<*>, x: T) = Unit
}
var a1: Int by A()
var a2: Int by A<String>()
class B<R>() {
operator fun <T> getValue(t: Any?, p: KProperty<*>): T = null!!
operator fun setValue(t: Any?, p: KProperty<*>, x: R) = Unit
}
var b1: Int by B()
var b2: Int by B<Number>()
class C<R>() {
operator fun getValue(t: Any?, p: KProperty<*>): R = null!!
operator fun <T> setValue(t: Any?, p: KProperty<*>, x: T) = Unit
}
var c1: Int by C()
var c2: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>C<Number>()<!>