Skip to content

Instantly share code, notes, and snippets.

@atamborrino
Last active October 13, 2016 14:14
Show Gist options
  • Select an option

  • Save atamborrino/e747afa09b971df98f6859e51b89da85 to your computer and use it in GitHub Desktop.

Select an option

Save atamborrino/e747afa09b971df98f6859e51b89da85 to your computer and use it in GitHub Desktop.
No warning =(
scala> sealed trait Test
defined trait Test
scala> case class Test1(a: Boolean) extends Test
defined class Test1
scala> case class Test2(a: Boolean) extends Test
defined class Test2
scala> :paste
// Entering paste mode (ctrl-D to finish)
def test(t: Test) = t match {
case Test1(a) if a => ""
case Test2(a) => ""
}
// Exiting paste mode, now interpreting.
test: (t: Test)String
// No warning on "match may not be exhaustive" =(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment