FIR: Mute property-delegation-inference related tests

They started failing once we began reporting diagnostics from completion
The main reason is that we resolve `delegate()` call
from `delegate().getValue()` in the independent context, while in FE 1.0
it's being resolved within the same system as getValue

^KT-46420 Relates
This commit is contained in:
Denis.Zharkov
2021-04-27 13:26:54 +03:00
committed by teamcityserver
parent cd401b5b8a
commit 78ec4b5248
9 changed files with 28 additions and 9 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
import kotlin.reflect.KProperty
@@ -14,4 +15,4 @@ fun <Value : Any> delegate(): DelegateProvider<Value> = object : DelegateProvide
fun box(): String {
val value: String by delegate()
return value
}
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.reflect.KProperty
class TypeInference {
@@ -9,6 +9,6 @@ object T2 {
operator fun <T> Foo<T>.provideDelegate(host: T2, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.getValue(receiver: String, p: Any?): T = TODO()
val String.test1: String by delegate()
val String.test1: String by <!TYPE_MISMATCH!>delegate()<!>
val test2: String by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>delegate()<!>
}
@@ -0,0 +1,12 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object T3 {
interface Foo<T>
fun <T> delegate(): Foo<T> = TODO()
operator fun <T> Foo<T>.provideDelegate(host: T3, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.getValue(receiver: T3, p: Any?): T = TODO()
val test1: String by <!TYPE_MISMATCH!>delegate()<!>
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object T3 {
@@ -4,7 +4,7 @@
import kotlin.reflect.KProperty
abstract class MainActivity : DIAware1() {
val bar: Bar by instance1()
val bar: Bar by <!TYPE_MISMATCH!>instance1()<!>
}
class Bar
@@ -13,6 +13,5 @@ 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 test2: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>"OK"<!>
val test3 by "OK"
@@ -0,0 +1,9 @@
val test: String by <!TYPE_MISMATCH!>materializeDelegate()<!>
fun <T> materializeDelegate(): Delegate<T> = Delegate()
operator fun <K> K.provideDelegate(receiver: Any?, property: kotlin.reflect.KProperty<*>): K = this
class Delegate<V> {
operator fun getValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>): V = TODO()
}
@@ -1,5 +1,3 @@
// FIR_IDENTICAL
val test: String by materializeDelegate()
fun <T> materializeDelegate(): Delegate<T> = Delegate()
@@ -8,4 +6,4 @@ operator fun <K> K.provideDelegate(receiver: Any?, property: kotlin.reflect.KPro
class Delegate<V> {
operator fun getValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>): V = TODO()
}
}