blob: 3c8cee2566ea33146e88141b3f868a96e49fd26c [file]
// LANGUAGE: +ContextParameters
class Context
fun interface SAM {
context(context: Context)
fun foo(x: Int): Int
}
fun box(): String {
val sam1 = SAM { x -> x + 1 }
val sam2 = SAM { 2 }
val sam3 = SAM { it + 1 }
with(Context()) {
sam1.foo(0)
sam2.foo(0)
sam3.foo(0)
}
return "OK"
}