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,18 +0,0 @@
// FILE: 1.kt
package a
import b.B.*
import kotlin.reflect.KClass
class Companion
val f: KClass<a.Companion> = Companion::class
// FILE: 2.kt
package b
class B {
companion object Companion
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: 1.kt
package a
@@ -1,19 +0,0 @@
// FILE: 1.kt
package a
import b.*
import kotlin.reflect.KClass
class A
object B
val f: KClass<a.A> = A::class
val g: KClass<a.B> = B::class
// FILE: 2.kt
package b
object A
object B
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: 1.kt
package a
@@ -1,14 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.reflect.KClass
fun test(s: String) {
val f: () -> Int = s::hashCode
val g: () -> String = s::toString
val h: (Any?) -> Boolean = s::equals
val k: KClass<out String> = s::class
val l: KClass<*> = s::class
val m: KClass<String> = String::class
val n: KClass<Unit> = Unit::class
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.reflect.KClass
@@ -1,11 +0,0 @@
// !CHECK_TYPE
object Obj {
fun foo() {}
val bar = 2
}
fun test() {
checkSubtype<() -> Unit>(Obj::foo)
checkSubtype<() -> Int>(Obj::bar)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
object Obj {
@@ -1,13 +0,0 @@
// FILE: A.java
class A {
public CharSequence getFoo() { return null; }
}
// FILE: test.kt
fun test() {
with (A()) {
foo::toString
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: A.java
class A {
@@ -1,3 +0,0 @@
fun <T: Any> get(t: T): () -> String {
return t::toString
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun <T: Any> get(t: T): () -> String {
return t::toString
}