Last active
September 14, 2019 23:04
-
-
Save martinbonnin/ceaf1ad8345925dac418cbe208eec207 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val closeable = object: Closeable { | |
override fun close() { | |
throw Exception("exception from close") | |
} | |
} | |
closeable.use { | |
throw Exception("exception from use") | |
} | |
// Java6: | |
// Exception in thread "main" java.lang.Exception: exception from use | |
// at com.example.MainKt.main(Main.kt:13) | |
// Java7 +: | |
// | |
// Exception in thread "main" java.lang.Exception: exception from use | |
// at MainKt.main(Main.kt:11) | |
// at MainKt.main(Main.kt) | |
// Suppressed: java.lang.Exception: exception from close | |
// at MainKt$main$closeable$1.close(Main.kt:6) | |
// at kotlin.io.CloseableKt.closeFinally(Closeable.kt:56) | |
// at MainKt.main(Main.kt:10) | |
// ... 1 more | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment