// SKIP_TXT // !LANGUAGE: +ProperTypeInferenceConstraintsProcessing class A fun foo(a: A<*, in CharSequence>) {} fun coerce(t: T): U { 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 } fun coerce2(t: T): U { // We might report an error on unsound type reference Constrain?, too val constrain: Constrain? = null val bind = Bind(constrain) // WARNING: Type mismatch: inferred type is T but U was expected return bind.upcast(t) }