mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
21 lines
286 B
Kotlin
Vendored
21 lines
286 B
Kotlin
Vendored
interface T
|
|
|
|
object Foo {
|
|
private fun foo(p: T) = p
|
|
|
|
private val v: Int = {
|
|
val x = foo(O)
|
|
42
|
|
}()
|
|
|
|
private object O : T
|
|
|
|
val result = v
|
|
}
|
|
|
|
fun box(): String {
|
|
val foo = Foo
|
|
if (foo.result != 42) return "Fail: ${foo.result}"
|
|
return "OK"
|
|
}
|