[FIR] Consider ConeConstraintSystemHasContradiction as a good reason for DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE error
This commit is contained in:
committed by
Space Team
parent
9b7b517f43
commit
06e88b559a
-16
@@ -1,16 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class StringDelegate(val s: String) {
|
||||
operator fun getValue(a: Any?, p: KProperty<*>): Int = 42
|
||||
}
|
||||
|
||||
// NB no operator
|
||||
fun String.provideDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this)
|
||||
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
val test1: String by "OK"
|
||||
val test2: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH!>"OK"<!>
|
||||
val test3 by "OK"
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
Reference in New Issue
Block a user