Import quick fix: support provideDelegate
#KT-28049 Fixed
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
// FILE: first.before.kt
|
||||
// "Import" "true"
|
||||
// ERROR: Type 'A' has no method 'getValue(MyUI, KProperty<*>)' and thus it cannot serve as a delegate
|
||||
|
||||
package bs
|
||||
|
||||
import some.A
|
||||
|
||||
class MyUI {
|
||||
fun <T> bindResource(id: Int): A = A()
|
||||
|
||||
val image by <caret>bindResource<Int>(42)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// FILE: second.kt
|
||||
package some
|
||||
|
||||
import bs.MyUI
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A
|
||||
|
||||
operator fun A.provideDelegate(
|
||||
thisRef: MyUI,
|
||||
prop: KProperty<*>
|
||||
): ReadOnlyProperty<MyUI, A> = TODO()
|
||||
|
||||
|
||||
|
||||
|
||||
// FILE: first.after.kt
|
||||
// "Import" "true"
|
||||
// ERROR: Type 'A' has no method 'getValue(MyUI, KProperty<*>)' and thus it cannot serve as a delegate
|
||||
|
||||
package bs
|
||||
|
||||
import some.A
|
||||
import some.provideDelegate
|
||||
|
||||
class MyUI {
|
||||
fun <T> bindResource(id: Int): A = A()
|
||||
|
||||
val image by <caret>bindResource<Int>(42)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user