Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-03-04 17:54:33 +03:00
parent 186e0b0cba
commit 8884cbe415
2268 changed files with 1175 additions and 19754 deletions
@@ -1,13 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Cell<out V>(val value: V)
class GenericDelegate<V>(val value: V)
operator fun <T> T.provideDelegate(a: Any?, p: Any?) = GenericDelegate(this)
operator fun <W> GenericDelegate<W>.getValue(a: Any?, p: Any?) = Cell(value)
val test1: Cell<String> by "OK"
val test2: Cell<Any> by "OK"
val test3 by "OK"
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Cell<out V>(val value: V)
@@ -1,12 +0,0 @@
// !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 delegate()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object T3 {
@@ -1,11 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
fun test(): String {
val result by "OK"
return result
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
@@ -1,19 +0,0 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.reflect.KProperty
object Foo
object Bar
object Baz
operator fun Foo.provideDelegate(receiver: Any?, property: KProperty<*>) = this
operator fun Bar.provideDelegate(receiver: Any?, property: KProperty<*>) = this
operator fun Foo.getValue(nothing: Any?, property: KProperty<*>): Any = TODO()
operator fun Bar.getValue(nothing: Any?, property: KProperty<*>): Any = TODO()
operator fun Baz.getValue(nothing: Any?, property: KProperty<*>): Any = TODO()
fun test() {
val bar by Baz
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE
@@ -1,10 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
val test1: String by "OK"
val test2 by "OK"
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty