// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun test(numbers: List) { // 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 => // Short <: Comparable, ILT <: Comparable => // Comparable <: Comparable, Comparable <: Comparable => // R <: Short, R <: ILT => // R := Short, R := ILT // => we should pick Short as it more specific shortComparable { getShort() ?: 1 } } fun shortExpected(f: () -> R) {} fun > shortComparable(f: () -> R) {} fun getShort(): Short? = 1