Skip to content

Commit 673a646

Browse files
committed
Fix #4051: Add regression test
1 parent b668f16 commit 673a646

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

compiler/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,18 @@ class ReplCompilerTests extends ReplTest {
110110
run("def f(g: => Int): Int = g")
111111
assertTrue(storedOutput().startsWith("def f(g: => Int): Int"))
112112
}
113+
114+
@Test def i4051 = fromInitialState { implicit state =>
115+
val source =
116+
"""val x: PartialFunction[Int, Int] = { case x => x }
117+
|val y = Map(("A", 1), ("B", 2), ("X", 3)).collect { case (k, v) => v }.toList""".stripMargin
118+
119+
val expected = List(
120+
"val x: PartialFunction[Int, Int] = <function1>",
121+
"val y: List[Int] = List(1, 2, 3)"
122+
)
123+
124+
run(source)
125+
assertEquals(expected, storedOutput().split("\n").toList)
126+
}
113127
}

0 commit comments

Comments
 (0)