Files
kotlin-fork/idea/testData/quickfix/autoImports/delegateExtensionProvideDelegate.test
T
Dmitry Gridin 1ee827bfc8 Import quick fix: support provideDelegate
#KT-28049 Fixed
2019-09-24 16:27:10 +07:00

51 lines
841 B
Plaintext
Vendored

// 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)
}