// TARGET_BACKEND: JVM // NO_CHECK_LAMBDA_INLINING // FILE: 1.kt package test // Following examples expected to fail inline fun takeTFail(t: T) {} inline fun takeUSuperInt(u: U) {} // FILE: 2.kt import test.* inline fun assertThrows(block: () -> Unit) { try { block.invoke() } catch (t: Throwable) { if (t is T) return throw t } throw AssertionError("Exception was expected") } fun box(): String { val f = { null } as () -> Int assertThrows { takeTFail(f()) } assertThrows { takeUSuperInt(f()) } return "OK" }