Skip to content

Commit dc6bc20

Browse files
committed
Make sure REPL tests run with -unchecked flag
1 parent 302973e commit dc6bc20

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/test/dotty/tools/dotc/repl/TestREPL.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import java.io.StringWriter
88

99
/** A subclass of REPL used for testing.
1010
* It takes a transcript of a REPL session in `script`. The transcript
11-
* starts with the first input prompt `scala> ` and ends with `scala> :quit` and a newline.
11+
* starts with the first input prompt `scala> ` and ends with `scala> :quit`.
1212
* Invoking `process()` on the `TestREPL` runs all input lines and
1313
* collects then interleaved with REPL output in a string writer `out`.
1414
* Invoking `check()` checks that the collected output matches the original
@@ -24,6 +24,7 @@ class TestREPL(script: String) extends REPL {
2424
override def context(ctx: Context) = {
2525
val fresh = ctx.fresh
2626
fresh.setSetting(ctx.settings.color, "never")
27+
fresh.setSetting(ctx.settings.unchecked, true)
2728
fresh.setSetting(ctx.settings.classpath, Jars.dottyReplDeps.mkString(":"))
2829
fresh.initialize()(fresh)
2930
fresh

tests/repl/errmsgs.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
7979
| ^^^^^^^^
8080
| value `barr` is not a member of Foo(foo) - did you mean `foo.bar`?
8181
scala> def unsafeCast[S](a: Any) = a match { case s: S => s; case _ => ??? }
82-
-- Warning: <console> ----------------------------------------------------------
82+
-- [E034] Erased Type Unchecked Warning: <console> -----------------------------
8383
4 |def unsafeCast[S](a: Any) = a match { case s: S => s; case _ => ??? }
8484
| ^
8585
| abstract type pattern is unchecked since it is eliminated by erasure

0 commit comments

Comments
 (0)