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,12 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
object Wrong
interface IA
interface IB : IA
fun IA.foo(vararg x: Int) = Wrong
fun IB.foo(vararg x: Int) = Right
class CC : IB
val test7 = CC().foo(1, 2, 3)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
@@ -1,13 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
object Wrong
interface A<T>
interface B<T> : A<T>
fun <T> foo(vararg t: T) = Wrong
fun <T> foo(t: A<T>) = Wrong
fun <T> foo(t: B<T>) = Right
fun test(b: B<Int>): Right = foo(b)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
@@ -1,10 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
object Wrong
fun overloadedFun(c: Any = "", b: String = "", f: Any = "") = Right
fun overloadedFun(b: Any = "", c: Any = "", e: String = "", x: String = "", y: String = "") = Wrong
val test: Right = overloadedFun(b = "")
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
@@ -1,9 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Foo1
object Foo2
fun foo(vararg ss: String) = Foo1
fun foo(x: Any) = Foo2
val test1: Foo1 = foo("")
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Foo1
@@ -1,11 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
object Wrong
fun overloadedFun6(s1: String) = Right
fun overloadedFun6(s1: String, s2: String) = Wrong
fun overloadedFun6(s1: String, s2: String, s3: String) = Wrong
fun overloadedFun6(s: String, vararg ss: String) = Wrong
val test6: Right = overloadedFun6("")
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
@@ -1,21 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: J.java
import java.util.*;
public class J {
public static <E1 extends Enum<E1>> String foo(E1 e) { return ""; }
public static <E2 extends Enum<E2>> String foo(E2 e1, E2 e2) { return ""; }
public static <E3 extends Enum<E3>> String foo(E3 s1, E3 s2, E3 s3) { return ""; }
public static <E4 extends Enum<E4>> int foo(E4... ss) { return 0; }
}
// FILE: test.kt
enum class X { A }
val a = X.A
val test0: Int = J.foo<X>()
val test1: String = J.foo(a)
val test2: String = J.foo(a, a)
val test3: String = J.foo(a, a, a)
val test4: Int = J.foo(a, a, a, a)
val test5: Int = J.foo(a, a, a, a, a)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: J.java
import java.util.*;