Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
-30
@@ -1,30 +0,0 @@
|
||||
//!DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> Iterable<*>.filterIsInstance1(): List<@kotlin.internal.NoInfer R> = throw Exception()
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> List<*>.filterIsInstance2(): @kotlin.internal.NoInfer List<R> = throw Exception()
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.filterIsInstance1<Int>().map { it * 2 }
|
||||
list.filterIsInstance2<Int>().filter { it > 10 }
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> foo(t: R): List<@kotlin.internal.NoInfer R> = throw Exception("$t")
|
||||
|
||||
fun test() {
|
||||
foo(1).map { it * 2 }
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> List<R>.foo(): @kotlin.internal.NoInfer R = throw Exception()
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> bar(r: R, f: Function1<@kotlin.internal.NoInfer R, Unit>): Nothing = throw Exception()
|
||||
|
||||
fun test1() {
|
||||
listOf("").foo().length
|
||||
bar(1) { x -> x + 1 }
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
//!DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
annotation class Anno
|
||||
|
||||
fun test(a: List<Class<Anno>>) {
|
||||
strictSelect(a, emptyList<Anno>().map { it.annotationClass.java })
|
||||
}
|
||||
|
||||
fun <@kotlin.internal.OnlyInputTypes S> strictSelect(arg1: S, arg2: S): S = TODO()
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// FILE: TestBase.java
|
||||
|
||||
public class TestBase<T> { }
|
||||
|
||||
// FILE: Test.java
|
||||
|
||||
public class Test<K> extends TestBase<K> { }
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <@kotlin.internal.OnlyInputTypes K> TestBase<out K>.foo(key: K) = null
|
||||
fun foo(result: Test<*>) {
|
||||
result.foo("sd") // Type inference failed (NI), OK in OI
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
interface IFace<K, out V>
|
||||
|
||||
fun <@kotlin.internal.OnlyInputTypes K, V> IFace<out K, V>.get(key: K): V? = TODO()
|
||||
fun <@kotlin.internal.OnlyInputTypes I> id(arg: I): I = arg
|
||||
|
||||
interface InvBase<B>
|
||||
class DerivedInv : InvBase<DerivedInv>
|
||||
class InvRecursive<E : InvBase<E>>
|
||||
|
||||
fun test1(argument: InvRecursive<*>, receiver: IFace<InvRecursive<DerivedInv>, Any>) {
|
||||
receiver.get(argument)
|
||||
}
|
||||
|
||||
fun test2(arg: InvRecursive<out DerivedInv>) {
|
||||
id(arg)
|
||||
}
|
||||
|
||||
fun test3(arg: InvRecursive<in DerivedInv>) {
|
||||
id(arg)
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
//!DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
//FILE:Foo.java
|
||||
|
||||
public class Foo {
|
||||
public static String foo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//FILE:Bar.kt
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <@kotlin.internal.OnlyInputTypes T> assertEquals1(t1: T, t2: T) {}
|
||||
|
||||
fun test() {
|
||||
assertEquals1(null, Foo.foo())
|
||||
assertEquals1("", Foo.foo())
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
//!DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
//FILE:Foo.java
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
fun test1(ns: String?, vararg nullableStrs: String?) {
|
||||
nullableStrs.contains("x")
|
||||
nullableStrs.contains(ns)
|
||||
"x" in nullableStrs
|
||||
ns in nullableStrs
|
||||
}
|
||||
|
||||
fun test2(ns: String?, vararg nonNullableStrs: String) {
|
||||
nonNullableStrs.contains("x")
|
||||
nonNullableStrs.contains(ns)
|
||||
"x" in nonNullableStrs
|
||||
ns in nonNullableStrs
|
||||
}
|
||||
|
||||
fun test3(ns: String?, nullableStrs: Array<out String?>, nonNullableStrs: Array<out String>) {
|
||||
nullableStrs.contains("x")
|
||||
nonNullableStrs.contains("x")
|
||||
|
||||
nullableStrs.contains(ns)
|
||||
nonNullableStrs.contains(ns)
|
||||
|
||||
"x" in nullableStrs
|
||||
"x" in nonNullableStrs
|
||||
ns in nullableStrs
|
||||
ns in nonNullableStrs
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
fun test1(ns: String?, vararg nullableStrs: String?) {
|
||||
nullableStrs.contains("x")
|
||||
nullableStrs.contains(ns)
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
private object TopLevelTypeVariable {
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> foo(): @kotlin.internal.NoInfer T = TODO()
|
||||
|
||||
fun <K> bar(k: K) {}
|
||||
|
||||
fun test() {
|
||||
bar(foo<Int>())
|
||||
}
|
||||
}
|
||||
|
||||
private object NestedTypeVariable {
|
||||
class Inv<T>
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> foo(): Inv<@kotlin.internal.NoInfer T> = TODO()
|
||||
|
||||
fun <K> bar(p: Inv<K>) {}
|
||||
|
||||
fun test() {
|
||||
bar(foo<String>())
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
private object TopLevelTypeVariable {
|
||||
|
||||
Reference in New Issue
Block a user