- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
getClass for AnyVals doesn't work in Pattern matching?
Sat, 2011-07-30, 22:55
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
[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