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,29 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionPerArgument
// !CHECK_TYPE
// FILE: J.java
public interface J<T> {
void f_t(F<T> f1, F<T> f2);
<R> void f_r(F<R> f1, F<R> f2);
<R> void f_pr(F<PR<T, R>> f1, F<PR<T, R>> f2);
}
// FILE: F.java
public interface F<S> {
void apply(S s);
}
// FILE: PR.java
public interface PR<X, Y> {}
// FILE: 1.kt
fun test(
j: J<String>,
f_string: F<String>,
f_int: F<Int>,
f_pr: F<PR<String, Int>>
) {
j.f_t(f_string) { it checkType { _<String>() } }
j.f_r(f_int) { it checkType { _<Int>() } }
j.f_pr(f_pr) { it checkType { _<PR<String, Int>>() } }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionPerArgument
// !CHECK_TYPE
// FILE: J.java
@@ -1,27 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
// !CHECK_TYPE
// FILE: F.java
public interface F<S> {
void apply(S s);
}
// FILE: PR.java
public interface PR<X, Y> {}
// FILE: 1.kt
interface K<T> {
fun f_t(f1: F<T>, f2: F<T>)
fun <R> f_r(f1: F<R>, f2: F<R>)
fun <R> f_pr(f1: F<PR<T, R>>, f2: F<PR<T, R>>)
}
fun test(
k: K<String>,
f_string: F<String>,
f_int: F<Int>,
f_pr: F<PR<String, Int>>
) {
k.f_t(f_string) { it checkType { _<String>() } }
k.f_r(f_int) { it checkType { _<Int>() } }
k.f_pr(f_pr) { it checkType { _<PR<String, Int>>() } }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
// !CHECK_TYPE
// FILE: F.java
@@ -1,34 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionPerArgument
// FILE: J.java
public interface J {
public void foo1(Runnable r);
public void foo2(Runnable r1, Runnable r2);
public void foo3(Runnable r1, Runnable r2, Runnable r3);
}
// FILE: Runnable.java
public interface Runnable {
void run();
}
// FILE: 1.kt
fun test(j: J, r: Runnable) {
j.foo1(r)
j.foo1({})
j.foo2(r, r)
j.foo2({}, {})
j.foo2(r, {})
j.foo2({}, r)
j.foo3(r, r, r)
j.foo3(r, r, {})
j.foo3(r, {}, r)
j.foo3(r, {}, {})
j.foo3({}, r, r)
j.foo3({}, r, {})
j.foo3({}, {}, r)
j.foo3({}, {}, {})
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionPerArgument
// FILE: J.java
public interface J {
@@ -1,31 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
// FILE: Runnable.java
public interface Runnable {
void run();
}
// FILE: 1.kt
interface K {
fun foo1(r: Runnable)
fun foo2(r1: Runnable, r2: Runnable)
fun foo3(r1: Runnable, r2: Runnable, r3: Runnable)
}
fun test(k: K, r: Runnable) {
k.foo1(r)
k.foo1({})
k.foo2(r, r)
k.foo2({}, {})
k.foo2(r, {})
k.foo2({}, r)
k.foo3(r, r, r)
k.foo3(r, r, {})
k.foo3(r, {}, r)
k.foo3(r, {}, {})
k.foo3({}, r, r)
k.foo3({}, r, {})
k.foo3({}, {}, r)
k.foo3({}, {}, {})
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
// FILE: Runnable.java
public interface Runnable {
@@ -1,26 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
// FILE: Action.java
public interface Action<T> {
void execute(T t);
}
// FILE: Other.java
// It's important that this is Java
public interface Other {
void pluginManagement(Action<? super Number> pluginManagementSpec);
}
// FILE: test.kt
interface B {
fun pluginManagement(block: Number.() -> Unit): Unit {}
}
interface C : B, Other
fun test(c: C) {
c.pluginManagement {
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE