// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +ProperTypeInferenceConstraintsProcessing fun main(args: Array) { val zero = coerce(0) } fun coerce(t: T): U { // Should be an error somewhere because this code leads to unsoundness // We may report that `Constrain?` type definition is unsound or the call `Bind(constrain)` // See KT-50230 val constrain: Constrain? = null val bind = Bind(constrain) return bind.upcast(t) } class Constrain class Bind(val constrain: Constrain?) { fun upcast(c: C): A = c }