Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
abstract class A {
|
||||
abstract fun foo(): Int
|
||||
}
|
||||
|
||||
class B() : A() {
|
||||
override fun foo() = 1
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
abstract class A {
|
||||
abstract fun foo(): Int
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
abstract class A {
|
||||
abstract val i: Int
|
||||
}
|
||||
|
||||
class B() : A() {
|
||||
override val i = 1
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
abstract class A {
|
||||
abstract val i: Int
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
abstract class A {
|
||||
abstract var i: Int
|
||||
}
|
||||
|
||||
class B() : A() {
|
||||
override var i = 1
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
abstract class A {
|
||||
abstract var i: Int
|
||||
}
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
interface Y {
|
||||
fun foo(a : Int = 1)
|
||||
}
|
||||
|
||||
interface YSub : Y {
|
||||
|
||||
}
|
||||
|
||||
class Z2 : Y, YSub {
|
||||
override fun foo(a : Int) {}
|
||||
}
|
||||
|
||||
object Z2O : Y, YSub {
|
||||
override fun foo(a : Int) {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Y {
|
||||
fun foo(a : Int = 1)
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package delegation
|
||||
|
||||
interface Aaa {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class Bbb(aaa: Aaa) : Aaa by aaa
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package delegation
|
||||
|
||||
interface Aaa {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package delegation
|
||||
|
||||
interface Aaa {
|
||||
val i: Int
|
||||
}
|
||||
|
||||
class Bbb(aaa: Aaa) : Aaa by aaa
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package delegation
|
||||
|
||||
interface Aaa {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package delegation
|
||||
|
||||
interface Aaa {
|
||||
var i: Int
|
||||
}
|
||||
|
||||
class Bbb(aaa: Aaa) : Aaa by aaa
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package delegation
|
||||
|
||||
interface Aaa {
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
interface Foo
|
||||
interface Bar
|
||||
|
||||
interface A {
|
||||
fun <T> foo()
|
||||
where T : Foo, T : Bar
|
||||
= Unit
|
||||
}
|
||||
|
||||
class B : A {
|
||||
override fun <T> foo()
|
||||
where T : Foo, T : Bar
|
||||
= Unit
|
||||
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Foo
|
||||
interface Bar
|
||||
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
open class Ccc() {
|
||||
fun foo() = 1
|
||||
}
|
||||
|
||||
interface Ttt {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
class Zzz() : Ccc(), Ttt
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
open class Ccc() {
|
||||
fun foo() = 1
|
||||
}
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
open class A {
|
||||
private fun foo() : Int = 1
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun foo() : String = ""
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
open class A {
|
||||
private fun foo() : Int = 1
|
||||
}
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
interface X {
|
||||
fun foo(a : Int = 1)
|
||||
}
|
||||
|
||||
interface Y {
|
||||
fun foo(a : Int)
|
||||
}
|
||||
|
||||
class Z : X, Y {
|
||||
override fun foo(a : Int) {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface X {
|
||||
fun foo(a : Int = 1)
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
open class Base {
|
||||
protected open val prot: Int = 1
|
||||
internal open val int: Int = 1
|
||||
public open val pub: Int = 1
|
||||
}
|
||||
|
||||
class Child(
|
||||
override val prot: Int,
|
||||
override val int: Int,
|
||||
override val pub: Int
|
||||
) : Base()
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
open class Base {
|
||||
protected open val prot: Int = 1
|
||||
internal open val int: Int = 1
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// NamedFunctionDescriptor.substitute substitutes "overrides"
|
||||
// this test checks it does it properly
|
||||
|
||||
interface Foo<P> {
|
||||
fun quux(p: P, q: Int = 17) : Int = 18
|
||||
}
|
||||
|
||||
interface Bar<Q> : Foo<Q>
|
||||
|
||||
abstract class Baz() : Bar<String>
|
||||
|
||||
fun zz(b: Baz) = b.quux("a")
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// NamedFunctionDescriptor.substitute substitutes "overrides"
|
||||
// this test checks it does it properly
|
||||
|
||||
|
||||
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
// FILE: J.java
|
||||
public interface J {
|
||||
String foo(); // String!
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
interface K1 {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
interface K2 {
|
||||
fun foo(): String?
|
||||
}
|
||||
|
||||
interface KDerived1a : K1, J
|
||||
|
||||
interface KDerived1b : J, K1
|
||||
|
||||
interface KDerived2a : K2, J
|
||||
|
||||
interface KDerived2b : J, K2
|
||||
|
||||
interface KDerived12a : K1, K2, J
|
||||
|
||||
interface KDerived12b : K1, J, K2
|
||||
|
||||
interface KDerived12c : J, K1, K2
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: J.java
|
||||
public interface J {
|
||||
String foo(); // String!
|
||||
|
||||
Vendored
-61
@@ -1,61 +0,0 @@
|
||||
// FILE: InOut.kt
|
||||
interface In<in T>
|
||||
|
||||
// FILE: J1.java
|
||||
public interface J1 {
|
||||
In<String> foo();
|
||||
}
|
||||
|
||||
// FILE: J2.java
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
public interface J2 {
|
||||
@NotNull In<String> foo();
|
||||
}
|
||||
|
||||
// FILE: J3.java
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
public interface J3 {
|
||||
@Nullable In<String> foo();
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
interface K1 {
|
||||
fun foo(): In<String>
|
||||
}
|
||||
|
||||
interface K2 {
|
||||
fun foo(): In<String?>
|
||||
}
|
||||
|
||||
// FIXME TestJ1K1 should have foo(): In<String!>, since In<String!> <: In<String>.
|
||||
interface TestJ1K1 : J1, K1
|
||||
interface TestK1J1 : K1, J1
|
||||
|
||||
interface TestJ1K2 : J1, K2
|
||||
interface TestK2J1 : K2, J1
|
||||
|
||||
interface TestJ2K1 : J2, K1
|
||||
interface TestK1J2 : K1, J2
|
||||
|
||||
interface TestJ2K2 : J2, K2
|
||||
interface TestK2J2 : K2, J2
|
||||
|
||||
interface TestJ3K1 : J3, K1
|
||||
interface TestK1J3 : K1, J3
|
||||
|
||||
interface TestJ3K2 : J3, K2
|
||||
interface TestK2J3 : K2, J3
|
||||
|
||||
interface TestJ1K1K2 : J1, K1, K2
|
||||
interface TestK1J1K2 : K1, J1, K2
|
||||
interface TestK1K2J1 : K1, K2, J1
|
||||
|
||||
interface TestJ2K1K2 : J2, K1, K2
|
||||
interface TestK1J2K2 : K1, J2, K2
|
||||
interface TestK1K2J2 : K1, K2, J2
|
||||
|
||||
interface TestJ3K1K2 : J3, K1, K2
|
||||
interface TestK1J3K2 : K1, J3, K2
|
||||
interface TestK1K2J3 : K1, K2, J3
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: InOut.kt
|
||||
interface In<in T>
|
||||
|
||||
|
||||
Vendored
-56
@@ -1,56 +0,0 @@
|
||||
// FILE: JFooWithUpperBound.java
|
||||
public interface JFooWithUpperBound<T extends IBase> {
|
||||
T foo();
|
||||
}
|
||||
|
||||
// FILE: JFooWithUpperBoundDerived.java
|
||||
public interface JFooWithUpperBoundDerived<T extends IBase> extends JFooWithUpperBound<T> {
|
||||
}
|
||||
|
||||
// FILE: JCFooWithUpperBound.java
|
||||
public class JCFooWithUpperBound<T extends IBase> {
|
||||
public T foo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: JCFooWithUpperBoundDerived.java
|
||||
public class JCFooWithUpperBoundDerived<T extends IBase> extends JCFooWithUpperBound<T> {
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
interface IBase
|
||||
|
||||
interface IDerived : IBase
|
||||
|
||||
interface IFooWithUpperBound<T : IBase> {
|
||||
fun foo(): T
|
||||
}
|
||||
|
||||
interface IFooT<T> {
|
||||
fun foo(): T
|
||||
}
|
||||
|
||||
interface IFoo {
|
||||
fun foo(): IBase
|
||||
}
|
||||
|
||||
interface IFooDerived : IFoo {
|
||||
override fun foo(): IDerived
|
||||
}
|
||||
|
||||
interface IFooWithUpperBoundDerived<T : IBase> : IFooWithUpperBound<T>
|
||||
|
||||
interface Test1<T : IBase> : IFooWithUpperBound<T>, IFoo
|
||||
|
||||
interface Test2<T : IBase> : IFooT<T>, IFoo
|
||||
|
||||
interface Test3<T : IDerived> : IFooWithUpperBoundDerived<T>, IFooDerived
|
||||
|
||||
interface Test4<T : IBase> : JFooWithUpperBound<T>, IFoo
|
||||
|
||||
interface Test5<T : IDerived> : JFooWithUpperBoundDerived<T>, IFooDerived
|
||||
|
||||
class Test6<T : IBase> : JCFooWithUpperBound<T>(), IFoo
|
||||
|
||||
class Test7<T : IDerived> : JCFooWithUpperBoundDerived<T>(), IFooDerived
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: JFooWithUpperBound.java
|
||||
public interface JFooWithUpperBound<T extends IBase> {
|
||||
T foo();
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_REFERENCE
|
||||
|
||||
class Foo
|
||||
|
||||
fun test(a: Foo, b: Foo) {
|
||||
// Note that signature matches the 'equals'
|
||||
fun equals(x: Any?): Boolean = false
|
||||
equals(b)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_REFERENCE
|
||||
|
||||
class Foo
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
interface IBase {
|
||||
override fun toString(): String
|
||||
}
|
||||
|
||||
interface IDerived : IBase
|
||||
|
||||
object BaseImpl : IBase {
|
||||
override fun toString(): String = "A"
|
||||
}
|
||||
|
||||
object DerivedImpl : IDerived {
|
||||
override fun toString(): String = "A"
|
||||
}
|
||||
|
||||
class Test1 : IBase by BaseImpl
|
||||
|
||||
class Test2 : IDerived by DerivedImpl
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface IBase {
|
||||
override fun toString(): String
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
open class A {
|
||||
private fun foo() {}
|
||||
|
||||
inner class B : A() {
|
||||
private fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
class C : A() {
|
||||
private fun foo() {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
open class A {
|
||||
private fun foo() {}
|
||||
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// FILE: Super.java
|
||||
|
||||
interface Super {
|
||||
void foo(long superName);
|
||||
}
|
||||
|
||||
// FILE: Sub.java
|
||||
|
||||
interface Sub extends Super {
|
||||
}
|
||||
|
||||
// FILE: SubSub.kt
|
||||
|
||||
class SubSub : Sub {
|
||||
override fun foo(subName: Long) {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: Super.java
|
||||
|
||||
interface Super {
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
// FILE: KSuper.kt
|
||||
|
||||
interface KSuper {
|
||||
fun foo(ksuperName: Int)
|
||||
}
|
||||
|
||||
// FILE: JSuper1.java
|
||||
|
||||
interface JSuper1 {
|
||||
void foo(int jsuper1Name);
|
||||
}
|
||||
|
||||
// FILE: JSuper2.java
|
||||
|
||||
interface JSuper2 {
|
||||
void foo(int jsuper2Name);
|
||||
}
|
||||
|
||||
|
||||
// FILE: Sub1.java
|
||||
interface Sub1 extends KSuper, JSuper1, JSuper2 {
|
||||
@Override
|
||||
void foo(int sub1Name);
|
||||
}
|
||||
|
||||
// FILE: Sub2.java
|
||||
interface Sub2 extends JSuper1, KSuper, JSuper2 {
|
||||
@Override
|
||||
void foo(int sub2Name);
|
||||
}
|
||||
|
||||
// FILE: Sub3.java
|
||||
interface Sub3 extends JSuper1, JSuper2, KSuper {
|
||||
@Override
|
||||
void foo(int sub3Name);
|
||||
}
|
||||
|
||||
|
||||
// FILE: SubSub.kt
|
||||
|
||||
class SubSub1 : Sub1 {
|
||||
override fun foo(ksuperName: Int) {}
|
||||
}
|
||||
|
||||
class SubSub2 : Sub2 {
|
||||
override fun foo(ksuperName: Int) {}
|
||||
}
|
||||
|
||||
class SubSub3 : Sub3 {
|
||||
override fun foo(ksuperName: Int) {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: KSuper.kt
|
||||
|
||||
interface KSuper {
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// FILE: JavaInterface.java
|
||||
|
||||
public interface JavaInterface {
|
||||
void foo(int javaName);
|
||||
}
|
||||
|
||||
// FILE: kotlin.kt
|
||||
|
||||
class SimpleSubclass : JavaInterface {
|
||||
override fun foo(kotlinName: Int) {}
|
||||
}
|
||||
|
||||
|
||||
interface SubtraitWithFakeOverride : JavaInterface
|
||||
|
||||
class Subclass : SubtraitWithFakeOverride {
|
||||
override fun foo(otherKotlinName: Int) {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: JavaInterface.java
|
||||
|
||||
public interface JavaInterface {
|
||||
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
interface I1
|
||||
interface I2
|
||||
open class C
|
||||
|
||||
interface A {
|
||||
fun <T> foo(t: T) where T : I1, T : C, T : I2
|
||||
}
|
||||
|
||||
interface B1 : A {
|
||||
override fun <T> foo(t: T) where T : C, T : I1, T : I2
|
||||
}
|
||||
|
||||
interface B2 : A {
|
||||
override fun <T> foo(t: T) where T : I1, T : C, T : I2
|
||||
}
|
||||
|
||||
interface B3 : A {
|
||||
override fun <T> foo(t: T) where T : I1, T : I2, T : C
|
||||
}
|
||||
|
||||
interface B4 : A {
|
||||
override fun <T> foo(t: T) where T : C, T : I2, T : I1
|
||||
}
|
||||
|
||||
interface B5 : A {
|
||||
override fun <T> foo(t: T) where T : I2, T : C, T : I1
|
||||
}
|
||||
|
||||
interface B6 : A {
|
||||
override fun <T> foo(t: T) where T : I2, T : I1, T : C
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface I1
|
||||
interface I2
|
||||
open class C
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
abstract class Base {
|
||||
abstract fun <T> foo(list: List<T>) where T : Number, T : Comparable<T>
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
override fun <T> foo(list: List<T>) where T : Number, T : Comparable<T> {
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
abstract class Base {
|
||||
abstract fun <T> foo(list: List<T>) where T : Number, T : Comparable<T>
|
||||
}
|
||||
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
interface A<R>
|
||||
|
||||
interface B {
|
||||
fun accept(visitor: String)
|
||||
fun <R> accept(visitor: A<R>): R
|
||||
}
|
||||
|
||||
interface C : B {
|
||||
override fun <R> accept(visitor: A<R>): R
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface A<R>
|
||||
|
||||
interface B {
|
||||
|
||||
Reference in New Issue
Block a user