Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
-22
@@ -1,22 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun take(fn: () -> List<String>) {}
|
||||
fun <L> inferFromLambda(fn: () -> L): L = TODO()
|
||||
|
||||
fun <T> materialize(): T = TODO()
|
||||
fun <I> id(arg: I) = arg
|
||||
|
||||
fun testFunctions() {
|
||||
take { materialize() }
|
||||
take(fun() = materialize())
|
||||
take(fun(): List<String> = materialize())
|
||||
take(fun(): List<String> {
|
||||
return materialize()
|
||||
})
|
||||
}
|
||||
|
||||
fun testNestedCalls() {
|
||||
id<String>(inferFromLambda { materialize() })
|
||||
id<String>(inferFromLambda(fun() = materialize()))
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class In<in I>(arg: I)
|
||||
class Out<out O>(val prop: O)
|
||||
class Inv<T>(val prop: T)
|
||||
|
||||
interface Upper
|
||||
class Lower : Upper
|
||||
|
||||
fun <K> id(arg: K): K = arg
|
||||
|
||||
fun test(lower: Lower) {
|
||||
id<Inv<Upper>>(Inv(lower))
|
||||
id<In<Upper>>(In(lower))
|
||||
id<Out<Upper>>(Out(lower))
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -USELESS_CAST
|
||||
|
||||
class Inv<T>
|
||||
class Out<out T>
|
||||
|
||||
fun <K> foo(y: K?) = Inv<Out<K>>()
|
||||
fun <R> test(x: Inv<Out<R>>) {}
|
||||
|
||||
fun main() {
|
||||
test<Int>(foo(null)) // type mismatch
|
||||
test<Number>(foo(1 as Int)) // type mismatch
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -USELESS_CAST
|
||||
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
interface Bound
|
||||
interface Upper : Bound
|
||||
class Lower : Upper
|
||||
|
||||
class Inv<T>
|
||||
|
||||
fun <T : Bound, U : T> makeInv(v: U): Inv<T> = TODO()
|
||||
fun <K> id(arg: K): K = arg
|
||||
|
||||
fun test(lower: Lower) {
|
||||
id<Inv<Upper>>(makeInv(lower))
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user