[NI] Use infered delegate expression type if there is no resolved call in trace

#KT-35707 Fixed
This commit is contained in:
Dmitriy Novozhilov
2019-12-27 11:49:24 +03:00
parent 605ef647e6
commit 9367c6a762
8 changed files with 55 additions and 3 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +NewInference
// ISSUE: KT-35707
import kotlin.reflect.KProperty
interface PropertyDelegate {
operator fun getValue(thisRef: A, property: KProperty<*>): Boolean = true
operator fun setValue(thisRef: A, property: KProperty<*>, value: Boolean) {}
}
class A {
val b by object : PropertyDelegate {}
}
fun box(): String {
return if (A().b) {
"OK"
} else {
"FAIL"
}
}