// !DIAGNOSTICS: -DEBUG_INFO_AUTOCAST trait Either trait Left: Either { val value: A } trait Right: Either { val value: B } class C1(val v1: Int) class C2(val v2: Int) fun _is_l(e: Either): Any { if (e !is Left) { return e } return e.value.v1 } fun _is_r(e: Either): Any { if (e !is Right) { return e } return e.value.v2 }