We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6098ec2 commit e4003b8Copy full SHA for e4003b8
tests/run/i10082.scala
@@ -0,0 +1,12 @@
1
+object Kotlin:
2
+ class Ctx[T](val x: T) extends AnyVal
3
+
4
+ def fun[T, U](fn: Ctx[T] ?=> U): T => U = (x: T) => fn(using Ctx(x))
5
+ def it[T](using ctx: Ctx[T]) = ctx.x
6
7
8
+import Kotlin._
9
10
+@main def Test =
11
+ val res = List(1).map(fun(it + 1))
12
+ assert(res == List(2))
0 commit comments