Skip to content

Conversation

@OlivierBlanvillain
Copy link
Contributor

@OlivierBlanvillain OlivierBlanvillain commented Mar 15, 2019

This PR silences a warning in test, thus making tests output more uniform.

This test in question 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 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.
@OlivierBlanvillain OlivierBlanvillain merged commit a6bab2c into scala:master Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants