Den Sh
unread,Dec 14, 2012, 7:25:28 AM12/14/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-i...@googlegroups.com
Hello,
I've stumbled upon an unexpected problem with reflection pattern matching:
scala> val u = scala.reflect.runtime.universe
u: scala.reflect.api.JavaUniverse = scala.reflect.runtime.JavaUniverse@18b679e1
scala> u.emptyValDef match { case u.emptyValDef => }
<console>:20: error: stable identifier required, but u.emptyValDef found.
Note that value emptyValDef is not stable because its type, => u.ValDef, is volatile.
u.emptyValDef match { case u.emptyValDef => }
^
scala> u.pendingSuperCall match { case u.pendingSuperCall => }
<console>:20: error: stable identifier required, but u.pendingSuperCall found.
Note that value pendingSuperCall is not stable because its type, => u.Apply, is volatile.
u.pendingSuperCall match { case u.pendingSuperCall => }
^
Can anything be done to aid pattern matching over this values ?