Skip to content

Commit 3f267a4

Browse files
committed
Add regression test for #19087
1 parent 9a79c14 commit 3f267a4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/pos/19087.scala

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
case class State(x: Int)
2+
3+
def foo[T](state: State)(body: => T): Option[T]
4+
Option.when(state.x == 0) body
5+
6+
var bar = 0
7+
val state = State(0)
8+
9+
def app: Function1[Int, Unit] =
10+
new Function1[Int, Unit]:
11+
def apply(x: Int): Unit =
12+
foo(state):
13+
foo(state.copy(x = 5): // Missing ")"
14+
println("a")
15+
bar = 2

0 commit comments

Comments
 (0)