Files
kotlin-fork/nj2k/testData/newJ2k/tryWithResource/WithCatchAndFinally.kt
T
Ilya Kirillov d0f0b9e355 New J2K: do not allow field and method declarations to be internal
For internal members new names are generated,
So, references to them from Java will be broken
2019-10-12 12:50:32 +03:00

18 lines
411 B
Kotlin
Vendored

import java.io.ByteArrayInputStream
import java.io.IOException
class C {
fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
println(c)
}
} catch (e: IOException) {
println(e)
} finally {
println("Finally!")
}
}
}