Fix add import quick fix for delegated property and missing extension

^KT-39199 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2021-03-12 14:22:16 +03:00
committed by TeamCityServer
parent f453649d0b
commit 943f03e55f
7 changed files with 68 additions and 11 deletions
@@ -0,0 +1,10 @@
// "Import" "true"
// WITH_RUNTIME
// ERROR: Type 'MyDelegate<TypeVariable(T)>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
package import
import base.MyDelegate
import base.getValue
val myVal by MyDelegate { false }
@@ -0,0 +1,7 @@
package base
class MyDelegate<T>(init: () -> T) {
var value: T = init()
}
operator fun <T> MyDelegate<T>.getValue(thisObj: Any?, property: kotlin.reflect.KProperty<*>): T = value
@@ -0,0 +1,9 @@
// "Import" "true"
// WITH_RUNTIME
// ERROR: Type 'MyDelegate<TypeVariable(T)>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
package import
import base.MyDelegate
val myVal by <caret>MyDelegate { false }