Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Feb 14, 2023
1 parent 8c616bf commit 74cf8a6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/pos/i16895.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

type Authorization = Unit

class Foo():
def apply(i: Int)(using Authorization): Int = i

def update(i: Int, f: Authorization ?=> Int): Unit = println(s"The new value of #$i is now ${f(using ())}")


@main def test() =
val foo = new Foo()
foo(42) = foo(42) + 1 //Ouputs: "The new value of #42 is now 43"
foo(42) += 1

0 comments on commit 74cf8a6

Please sign in to comment.