// TARGET_BACKEND: JVM // JVM_TARGET: 1.8 // See also kt33054.kt fun causesVerifyErrorSample(): Sample = Sample .Success(true) .flatMap { Sample.Failure(RuntimeException()) } sealed class Sample { inline fun flatMap(f: (T) -> Sample): Sample = when (this) { is Failure -> this is Success -> f(this.value) } data class Failure(val exception: Throwable): Sample() data class Success(val value: T): Sample() } fun box(): String { causesVerifyErrorSample() return "OK" }