// Issue: KT-18583 sealed class Maybe { class Nope(val reasonForLog: String, val reasonForUI: String) : Maybe() class Yeah(val meat: T) : Maybe() fun unwrap() = when (this) { is Nope -> throw Exception("") is Yeah -> meat } }