fb7165c7fa
#KT-4236 In Progress #KT-4600 In Progress #KT-4237 In Progress #KT-4207 In Progress #KT-4218 In Progress #KT-4263 Obsolete
26 lines
257 B
Kotlin
26 lines
257 B
Kotlin
// KT-4237 With in with
|
|
|
|
package foo
|
|
|
|
class A {
|
|
val ok = "OK"
|
|
}
|
|
|
|
class B
|
|
|
|
fun with<T>(o: T, body: T.() -> Unit) {
|
|
o.body()
|
|
}
|
|
|
|
fun box(): String {
|
|
var o = ""
|
|
|
|
with(A()) {
|
|
with(B()) {
|
|
o = ok
|
|
}
|
|
}
|
|
|
|
return o
|
|
}
|