From 41f686902bc3c28adb928b2244c2f714698c2e47 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Thu, 19 Dec 2024 15:52:16 +0100 Subject: [PATCH] Add replTest for `:silent` command --- compiler/test-resources/repl/silent | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 compiler/test-resources/repl/silent diff --git a/compiler/test-resources/repl/silent b/compiler/test-resources/repl/silent new file mode 100644 index 000000000000..9e851e8adb01 --- /dev/null +++ b/compiler/test-resources/repl/silent @@ -0,0 +1,25 @@ +scala>:silent +scala> 1+1 +scala> case class A(x: Int) +scala> A("string") +-- [E007] Type Mismatch Error: ------------------------------------------------- +1 | A("string") + | ^^^^^^^^ + | Found: ("string" : String) + | Required: Int + | + | longer explanation available when compiling with `-explain` +1 error found +scala> Option[Int](2) match { case Some(x) => x } +1 warning found +-- [E029] Pattern Match Exhaustivity Warning: ---------------------------------- +1 | Option[Int](2) match { case Some(x) => x } + | ^^^^^^^^^^^^^^ + | match may not be exhaustive. + | + | It would fail on pattern case: None + | + | longer explanation available when compiling with `-explain` +scala>:silent +scala> 1 + 2 +val res2: Int = 3