From 234190fa93b8cc1442dc7efbe3a0080194c85f3a Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Fri, 15 Mar 2019 17:06:10 +0100 Subject: [PATCH] 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. --- compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala b/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala index 842164339b24..c66386e97c89 100644 --- a/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala +++ b/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala @@ -46,6 +46,7 @@ trait DottyBytecodeTest { def initCtx = { val ctx0 = (new ContextBase).initialCtx.fresh val outputDir = new VirtualDirectory("") + ctx0.setSetting(ctx0.settings.silentWarnings, true) ctx0.setSetting(ctx0.settings.classpath, TestConfiguration.basicClasspath) ctx0.setProperty(ContextDoc, new ContextDocstrings) ctx0.setSetting(ctx0.settings.outputDir, outputDir)