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,13 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A<T> {
fun foo() = 1
}
interface B
public fun <E : B> E.bar() : A<out E> = null!!
fun baz(x: B) {
x.bar().foo()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A<T> {
@@ -1,16 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
// !CHECK_TYPE
// FILE: Clazz.java
public class Clazz<Psi> {
public java.util.Collection<Psi> foo() { return null; }
}
// FILE: main.kt
public fun <T, C : MutableCollection<in T>> Iterable<T>.filterTo(destination: C, predicate: (T) -> Boolean) {}
fun test(clazz: Clazz<out Any>) {
val result = java.util.ArrayList<Any>()
clazz.foo().filterTo(result) { x -> true }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
// !CHECK_TYPE
@@ -1,11 +0,0 @@
class A<T>
fun <T> A<T>.foo(): Collection<T> = null!!
fun main(a: A<*>, a1: A<out CharSequence>) {
// see KT-9571
for (i in a.foo()) { }
for (i: Any? in a.foo()) { }
for (i in a1.foo()) { }
for (i: CharSequence in a1.foo()) { }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class A<T>
fun <T> A<T>.foo(): Collection<T> = null!!
@@ -1,8 +0,0 @@
interface Subscriber<T>
interface Observable<T> {
fun subscribe(s: Subscriber<in T>)
}
fun foo(o: Observable<out CharSequence>, y: Subscriber<in CharSequence>) = o.subscribe(y) // type safe
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface Subscriber<T>
interface Observable<T> {
@@ -1,12 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// See KT-7296
interface Out<out F>
interface B<T> : Out<Out<T>>
fun foo(x : B<*>) {
bar1(x)
bar2(x)
}
fun bar1(x : Out<Out<*>>) { }
fun bar2(x : Out<*>) { }
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
// See KT-7296
interface Out<out F>