File tree Expand file tree Collapse file tree 2 files changed +27
-8
lines changed
Expand file tree Collapse file tree 2 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 1- def always (block : => Unit ): Unit = {}
2- def always (args : Int * )(block : => Unit ): Unit = {}
31
4- def test =
5- val x = always{}
6- val xc : Unit = x
7- always(1 ,2 ,3 ) {}
2+ package i14699:
3+ def always (block : => Unit ): Unit = ()
4+ def always (args : Int * )(block : => Unit ): Unit = ()
5+
6+ def test =
7+ val x = always{}
8+ val xc : Unit = x
9+ always(1 ,2 ,3 ) {}
10+
11+ package i15163:
12+ trait Ctx
13+ object Ctx :
14+ given Ctx ()
15+ def always (block : Ctx ?=> Unit ): Unit = block
16+ def always (args : Int * )(block : Ctx ?=> Unit ): Unit = block
17+
18+ def test =
19+ // val _ = always {}
20+ val _ = always { (x : Ctx ) ?=> () }
21+ always(1 ,2 ,3 ) {}
Original file line number Diff line number Diff line change 1- def f (init : Int ?=> Int ) : Int = 1
2- def f (s : String )(init : Int ?=> Int ) : Int = 2
1+ def f (init : Int ?=> Int ): Int = 1
2+ def f (s : String )(init : Int ?=> Int ): Int = 2
3+
4+ def g (init : String ?=> Int )(s : String ): Int = init(using s)
5+ def g (init : Int ?=> Int )(j : Int ): Int = init(using j)
36
47@ main def Test () =
58 assert(f((x : Int ) ?=> x) == 1 )
9+ assert(g((i : Int ) ?=> i+ 1 )(41 ) == 42 , s " ${ g((i : Int ) ?=> i+ 1 )(41 ) }" )
10+ // assert(g(summon[Int]+1)(41) == 42, s"${ g((i: Int) ?=> i+1)(41) }")
You can’t perform that action at this time.
0 commit comments