File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
compiler/test/dotty/tools/repl Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -462,10 +462,36 @@ class ReplCompilerTests extends ReplTest:
462462 .andThen:
463463 run(" 0" ) // check for crash
464464 val last = lines()
465- println(last)
466465 assertTrue(last(0 ), last(0 ) == (" Options incompatible with repl will be ignored: -Ybest-effort, -Ywith-best-effort-tasty" ))
467466 assertTrue(last(1 ), last(1 ) == (" val res0: Int = 0" ))
468467
468+ @ Test def `i9879` : Unit = initially :
469+ run {
470+ """ |opaque type A = Int; def getA: A = 0
471+ |object Wrapper { opaque type A = Int; def getA: A = 1 }
472+ |val x = getA
473+ |val y = Wrapper.getA""" .stripMargin
474+ }
475+ val expected = List (
476+ " def getA: A" ,
477+ " // defined object Wrapper" ,
478+ " val x: A = 0" ,
479+ " val y: Wrapper.A = 1"
480+ )
481+ assertEquals(expected, lines())
482+
483+ @ Test def `i9879b` : Unit = initially :
484+ run {
485+ """ |def test =
486+ | type A = Int
487+ | opaque type B = String
488+ | object Wrapper { opaque type C = Int }
489+ | ()""" .stripMargin
490+ }
491+ val all = lines()
492+ assertEquals(6 , all.length)
493+ assertTrue(all.head.startsWith(" -- [E103] Syntax Error" ))
494+ assertTrue(all.exists(_.trim().startsWith(" | Illegal start of statement: this modifier is not allowed here" )))
469495
470496object ReplCompilerTests :
471497
You can’t perform that action at this time.
0 commit comments