Skip to content

Commit 234190f

Browse files
Add -no-warn to a Bytecode test
This test is expected to produce a warning, but it ends up in the CI output and looks like an error: -- [E115] Syntax Warning: object Foo { import scala.annotation.switch def foo(i: Any) = (i: @switch) match { case x: String => println("string!") case x :: xs => println("list!") } }:4:33 4 | def foo(i: Any) = (i: @switch) match { | ^ |Could not emit switch for @switch annotated match since there are not enough cases 5 | case x: String => println("string!") 6 | case x :: xs => println("list!") 7 | } This commit silences that warning thus making tests output more uniform.
1 parent 09a56e5 commit 234190f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ trait DottyBytecodeTest {
4646
def initCtx = {
4747
val ctx0 = (new ContextBase).initialCtx.fresh
4848
val outputDir = new VirtualDirectory("<DottyBytecodeTest output>")
49+
ctx0.setSetting(ctx0.settings.silentWarnings, true)
4950
ctx0.setSetting(ctx0.settings.classpath, TestConfiguration.basicClasspath)
5051
ctx0.setProperty(ContextDoc, new ContextDocstrings)
5152
ctx0.setSetting(ctx0.settings.outputDir, outputDir)

0 commit comments

Comments
 (0)