Aladdin - Scala Bugtracking
[#1296] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Iulian moved to trac 2007-08-27 18:22:09.0
subject [contrib #772] Successful compilation of illegal match
code
object Foo extends Application {
  val (a: Boolean, b: String) = Some(Some(4)) getOrElse (false, "Foo")

  println(a+" "+b)
}
what happened
java.lang.ExceptionInInitializerError
        at Foo.main(bad2.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at scala.tools.nsc.ObjectRunner$$anonfun$0.apply(ObjectRunner.scala:75)
        at scala.tools.nsc.ObjectRunner$.withContextClassLoader(ObjectRunner.scala:49)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:74)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:154)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: scala.MatchError: Some(4)
        at Foo$.(bad2.scala:2)
        at Foo$.(bad2.scala)
        ... 10 more
what expected Compilation error
[back to overview]
Changes of this bug report
Stephane  edited on  2007-08-27 18:23:06.0
Gilles  edited on  2007-08-29 09:53:41.0