Skip to content

Commit dab1cf6

Browse files
committed
Make sure REPL tests run with -unchecked flag
1 parent f30c438 commit dab1cf6

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
@@ -10,7 +10,7 @@ import org.junit.Test
1010

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

tests/repl/errmsgs.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ scala> { def f: Int = g; val x: Int = 1; def g: Int = 5; }
9393

9494
longer explanation available when compiling with `-explain`
9595
scala> def unsafeCast[S](a: Any) = a match { case s: S => s; case _ => ??? }
96-
-- Warning: <console> ----------------------------------------------------------
96+
-- [E034] Erased Type Unchecked Warning: <console> -----------------------------
9797
4 |def unsafeCast[S](a: Any) = a match { case s: S => s; case _ => ??? }
9898
| ^
9999
| abstract type pattern is unchecked since it is eliminated by erasure

0 commit comments

Comments
 (0)