Aladdin - Scala Bugtracking
[#1295] project: interpreter priority: high category: bug
submitter assigned to status date submitted
Stephane Lex moved to trac 2007-08-27 18:12:45.0
subject [contrib #770] Extractor vals don't work in interpreter
code
class X { def unapply(v : Int) = Some(v + 1) }
val q = new X
5 match { case q(x) => x }
what happened
java.lang.ClassCastException:  cannot be cast to 
what expected Prints 6. This works in the compiler, and works in the interpreter if I use an object rather than class + val.
[back to overview]
Changes of this bug report
Stephane  edited on  2007-08-27 18:13:14.0
Gilles  edited on  2007-08-29 09:54:32.0