mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
17 lines
269 B
Kotlin
Vendored
17 lines
269 B
Kotlin
Vendored
class A {
|
|
fun foo(x: Int, y: Int) = x + y
|
|
}
|
|
|
|
fun box(): String {
|
|
val x = (A::foo).call(A(), 42, 239)
|
|
if (x != 281) return "Fail: $x"
|
|
|
|
try {
|
|
(A::foo).call()
|
|
return "Fail: no exception"
|
|
}
|
|
catch (e: Exception) {}
|
|
|
|
return "OK"
|
|
}
|