55cb9561c2
Split error reporting into two parts for incorrect and missing candidates. Missing function error is not reported on provideDelegate. Update error factory and default message for error. Update error texts in quick fix test data. #KT-16526 Fixed
42 lines
973 B
Plaintext
Vendored
42 lines
973 B
Plaintext
Vendored
// FILE: first.before.kt
|
|
// "Import" "true"
|
|
// ERROR: Type 'DelegateImpl<Int>' has no method 'setValue(BigTest, KProperty<*>, Int)' and thus it cannot serve as a delegate for var (read-write property)
|
|
|
|
package testing
|
|
|
|
import some.DelegateImpl
|
|
import some.getValue
|
|
|
|
class BigTest {
|
|
var a by <caret>DelegateImpl<Int>()
|
|
}
|
|
|
|
|
|
// FILE: second.kt
|
|
package some
|
|
|
|
import kotlin.reflect.KProperty
|
|
|
|
class DelegateImpl<T> {
|
|
val value: T = null!!
|
|
}
|
|
|
|
operator fun <T> DelegateImpl<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value
|
|
operator fun <T> DelegateImpl<T>.setValue(thisRef: Any, property: KProperty<*>, t: T) {}
|
|
|
|
|
|
|
|
// FILE: first.after.kt
|
|
// "Import" "true"
|
|
// ERROR: Type 'DelegateImpl<Int>' has no method 'setValue(BigTest, KProperty<*>, Int)' and thus it cannot serve as a delegate for var (read-write property)
|
|
|
|
package testing
|
|
|
|
import some.DelegateImpl
|
|
import some.getValue
|
|
import some.setValue
|
|
|
|
class BigTest {
|
|
var a by <caret>DelegateImpl<Int>()
|
|
}
|