File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
compiler/test/dotty/tools/repl Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -493,6 +493,24 @@ class ReplCompilerTests extends ReplTest:
493493 assertTrue(all.head.startsWith(" -- [E103] Syntax Error" ))
494494 assertTrue(all.exists(_.trim().startsWith(" | Illegal start of statement: this modifier is not allowed here" )))
495495
496+ @ Test def `i16250a` : Unit = initially :
497+ val hints = List (
498+ " this language import is not allowed in the REPL" ,
499+ " To use this language feature, include the flag `-language:experimental.captureChecking` when starting the REPL"
500+ )
501+ run(" import language.experimental.captureChecking" )
502+ val all = lines()
503+ assertTrue(hints.forall(hint => all.exists(_.contains(hint))))
504+
505+ @ Test def `i16250b` : Unit = initially :
506+ val hints = List (
507+ " this language import is not allowed in the REPL" ,
508+ " To use this language feature, include the flag `-language:experimental.pureFunctions` when starting the REPL"
509+ )
510+ run(" import language.experimental.pureFunctions" )
511+ val all = lines()
512+ assertTrue(hints.forall(hint => all.exists(_.contains(hint))))
513+
496514object ReplCompilerTests :
497515
498516 private val pattern = Pattern .compile(" \\ r[\\ n]?|\\ n" );
You can’t perform that action at this time.
0 commit comments