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,22 +0,0 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun test(numbers: List<Number>) {
// Short <: R, ILT <: R => CST(Short, ILT) = Short
// => we should pick Short in such situation as it more specific
shortExpected { getShort() ?: 1 }
// Short <: R, ILT <: R, R <: Comparable<R> =>
// Short <: Comparable<R>, ILT <: Comparable<R> =>
// Comparable<Short> <: Comparable<R>, Comparable<ILT> <: Comparable<R> =>
// R <: Short, R <: ILT =>
// R := Short, R := ILT
// => we should pick Short as it more specific
shortComparable { getShort() ?: 1 }
}
fun <R> shortExpected(f: () -> R) {}
fun <R : Comparable<R>> shortComparable(f: () -> R) {}
fun getShort(): Short? = 1
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER