This page is no longer maintained — Please continue to the home page at www.scala-lang.org

getClass for AnyVals doesn't work in Pattern matching?

1 reply
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
I tried to compile current trunk with the lastest nightly txz, that's what I got:

[scalacfork] /home/soc/Entwicklung/scala-new/src/compiler/scala/tools/nsc/transform/LiftCode.scala:144: error: type mismatch;
[scalacfork]  found   : value.type (with underlying type Any)
[scalacfork]  required: ?{val getClass: ?}
[scalacfork] Note that implicit conversions are not applicable because they are ambiguous:
[scalacfork]  both method any2Ensuring in object Predef of type [A](x: A)Ensuring[A]
[scalacfork]  and method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A]
[scalacfork]  are possible conversion functions from value.type to ?{val getClass: ?}
[scalacfork]             abort("don't know how to inject " + value + " of class "+ value.getClass)
[scalacfork]                                                                       ^
[scalacfork] /home/soc/Entwicklung/scala-new/src/compiler/scala/tools/nsc/transform/LiftCode.scala:174: error: type mismatch;
[scalacfork]  found   : value.type (with underlying type Any)
[scalacfork]  required: ?{val getClass: ?}
[scalacfork] Note that implicit conversions are not applicable because they are ambiguous:
[scalacfork]  both method any2Ensuring in object Predef of type [A](x: A)Ensuring[A]
[scalacfork]  and method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A]
[scalacfork]  are possible conversion functions from value.type to ?{val getClass: ?}
[scalacfork]         case _           => abort("don't know how to inject " + value + " of class " + value.getClass)
[scalacfork]                                                                                        ^
[scalacfork] two errors found

Source code in question: LiftCode
Does someone know what's the problem here? I tried to minimize the code, but couldn't come up with a stand-alone example exhibiting that problem.

Bye,


Simon
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Aw: [FIXED] getClass for AnyVals doesn't work in Pattern matchin
Sorry, seems to be my mistake. I deleted the build folder manually and it seems to work now.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland