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,5 +0,0 @@
// !LANGUAGE: +FunctionalInterfaceConversion
fun interface Foo {
fun invoke()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +FunctionalInterfaceConversion
fun interface Foo {
@@ -1,12 +0,0 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun interface Foo {
fun invoke()
}
fun foo(f: Foo) {}
fun test() {
foo {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// !DIAGNOSTICS: -UNUSED_PARAMETER
@@ -1,15 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun interface KRunnable {
fun invoke()
}
typealias KRunnableAlias = KRunnable
fun foo(f: KRunnable) {}
fun test() {
foo(KRunnable {})
foo(KRunnableAlias {})
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
@@ -1,25 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
// !CHECK_TYPE
fun interface F<S> {
fun apply(s: S)
}
interface PR<X, Y> {}
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 +FunctionalInterfaceConversion
// !CHECK_TYPE
@@ -1,33 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
interface J {
fun foo1(r: KRunnable)
fun foo2(r1: KRunnable, r2: KRunnable)
fun foo3(r1: KRunnable, r2: KRunnable, r3: KRunnable)
}
fun interface KRunnable {
fun run()
}
// FILE: 1.kt
fun test(j: J, r: KRunnable) {
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 +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
interface J {
@@ -1,14 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE
fun interface SuspendRunnable {
suspend fun invoke()
}
fun run(r: SuspendRunnable) {}
suspend fun bar() {}
fun test() {
run(::bar)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE