FIR: Add more tests for delegate inference
This commit is contained in:
committed by
teamcity
parent
bb411cbba7
commit
2e69f7732c
+16
@@ -0,0 +1,16 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Delegate<T>(val data: T) {
|
||||
operator fun getValue(thisRef: Nothing?, prop: KProperty<*>): T = data
|
||||
}
|
||||
|
||||
fun makeIntDelegate(t: Int): Delegate<Int> = Delegate(t)
|
||||
fun <TT> makeDelegate(t: TT): Delegate<TT> = Delegate(t)
|
||||
fun <M> materialize(): M = null!!
|
||||
fun <M2> materialize2(): M2 = null!!
|
||||
fun <Q> id(v: Q): Q = v
|
||||
|
||||
val x by makeIntDelegate(run {
|
||||
val x: String = materialize()
|
||||
materialize2()
|
||||
})
|
||||
Reference in New Issue
Block a user