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,6 +0,0 @@
data class A(val component1: Int)
fun foo(a: A) {
a.component1()
a.component1
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
data class A(val component1: Int)
fun foo(a: A) {
@@ -1,3 +0,0 @@
class Outer {
private data class Nested(val c: Int)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class Outer {
private data class Nested(val c: Int)
}
@@ -1,9 +0,0 @@
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
data class Test(val str: String, val int: Int) : WithCopy<String> {
override fun copy(str: String) = copy(str, int)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
interface WithCopy<T> {
@@ -1,16 +0,0 @@
abstract class Base {
final override fun equals(other: Any?) = false
final override fun hashCode() = 42
open override fun toString() = "OK"
}
data class Data1(val field: String) : Base()
interface AbstractAnyMembers {
abstract override fun equals(other: Any?): Boolean
abstract override fun hashCode(): Int
abstract override fun toString(): String
}
data class Data2(val field: String): Base(), AbstractAnyMembers
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
abstract class Base {
final override fun equals(other: Any?) = false
final override fun hashCode() = 42
@@ -1,5 +0,0 @@
interface T {
fun component1(): Int
}
data class A(val x: Int) : T
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface T {
fun component1(): Int
}
@@ -1,9 +0,0 @@
// !CHECK_TYPE
data class A(val x: Int, val y: String)
fun foo(a: A) {
val (b, c) = a
checkSubtype<Int>(b)
checkSubtype<String>(c)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
data class A(val x: Int, val y: String)
@@ -1,10 +0,0 @@
// !CHECK_TYPE
data class A(val x: Int, val y: String)
fun foo(arr: Array<A>) {
for ((b, c) in arr) {
checkSubtype<Int>(b)
checkSubtype<String>(c)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
data class A(val x: Int, val y: String)
@@ -1,6 +0,0 @@
class A(val x: Int, val y: String)
fun foo(a: A) {
a.<!UNRESOLVED_REFERENCE!>component1<!>()
a.<!UNRESOLVED_REFERENCE!>component2<!>()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class A(val x: Int, val y: String)
fun foo(a: A) {
@@ -1,8 +0,0 @@
// !CHECK_TYPE
data class A(val x: Int)
fun foo(a: A) {
checkSubtype<Int>(a.component1())
a.<!UNRESOLVED_REFERENCE!>component2<!>()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
data class A(val x: Int)
@@ -1,8 +0,0 @@
// !CHECK_TYPE
data class A(val x: Int, val y: String)
fun foo(a: A) {
checkSubtype<Int>(a.component1())
checkSubtype<String>(a.component2())
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
data class A(val x: Int, val y: String)
@@ -1,8 +0,0 @@
// !CHECK_TYPE
data class A(var x: Int, var y: String)
fun foo(a: A) {
checkSubtype<Int>(a.component1())
checkSubtype<String>(a.component2())
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
data class A(var x: Int, var y: String)