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
1.2 KiB
Plaintext
Vendored
42 lines
1.2 KiB
Plaintext
Vendored
// FILE: first.before.kt
|
|
// "Import" "true"
|
|
// ERROR: Type 'DelegateImpl<Int>' has no method 'getValue(BigTest, KProperty<*>)' and thus it cannot serve as a delegate
|
|
// ERROR: Type 'DelegateImpl<Int>' has no method 'setValue(BigTest, KProperty<*>, [ERROR : Type from delegate])' and thus it cannot serve as a delegate for var (read-write property)
|
|
|
|
package testing
|
|
|
|
import some.DelegateImpl
|
|
|
|
class BigTest {
|
|
var a by <caret>DelegateImpl<Int>()
|
|
}
|
|
|
|
|
|
// FILE: second.kt
|
|
package some
|
|
|
|
import kotlin.reflect.KProperty
|
|
|
|
class DelegateImpl<T> {
|
|
val value: T = null!!
|
|
}
|
|
|
|
public operator fun <T> DelegateImpl<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value
|
|
public 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 'getValue(BigTest, KProperty<*>)' and thus it cannot serve as a delegate
|
|
// ERROR: Type 'DelegateImpl<Int>' has no method 'setValue(BigTest, KProperty<*>, [ERROR : Type from delegate])' 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>()
|
|
}
|