- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Yet another continuations question!
Thu, 2009-09-10, 18:22
Suddenly I've started getting this exception in code that was
previously working fine:
Exception in thread "Thread-0" java.lang.ClassCastException:
java.lang.String cannot be cast to scala.continuations.ControlContext
at swarm.Ref$$anonfun$apply$2.apply(Ref.scala:10)
at swarm.Ref$$anonfun$apply$2.apply(Ref.scala:10)
at scala.continuations.ControlContext$$anonfun$flatMap$1$$anonfun$apply$2.apply(ControlContext.scala:27)
at scala.continuations.ControlContext$$anonfun$shiftUnitR$1.apply(ControlContext.scala:85)
at scala.continuations.ControlContext$$anonfun$shiftUnitR$1.apply(ControlContext.scala:85)
at scala.continuations.ControlContext$$anonfun$flatMap$1$$anonfun$apply$2.apply(ControlContext.scala:27)
at swarm.Swarm$$anon$1$$anonfun$run$1.apply(Swarm.scala:39)
at swarm.Swarm$$anon$1$$anonfun$run$1.apply(Swarm.scala:39)
at swarm.Swarm$$anonfun$run$2.apply(Swarm.scala:51)
at swarm.Swarm$$anonfun$run$2.apply(Swarm.scala:49)
at scala.continuations.ControlContext$.reifyR(ControlContext.scala:93)
at scala.continuations.ControlContext$.reset(ControlContext.scala:61)
at swarm.Swarm$.run(Swarm.scala:49)
at swarm.Swarm$$anon$1.run(Swarm.scala:39)
Since I'm not casting anything, I assume this is something to-do with
the plugin - here is the file:
http://github.com/sanity/Swarm/blob/78426cb5cd4136975d9809dc87ffe4d3157f...
I'd appreciate it if you could take a look.
Ian.
Hi Ian,
sorry it took me a while to answer, but as your code base gets larger,
it is increasingly difficult for me to find out what's wrong, mainly
because I first have to figure out how to run your demo programs. For
the future, I would very much appreciate if you could provide stripped
down test cases.
For the exception you are getting, I'm not yet sure what is happening
exactly, but removing the explicit typing
:Type@cps[Bee,Bee]
at the end of apply makes it work. It'd be great if could try to
reduce it down to a simple test case and create a trac ticket.
BTW, how did your presentation go? Did you get some good feedback?
- Tiark
On 10.09.2009, at 19:18, Ian Clarke wrote:
> Suddenly I've started getting this exception in code that was
> previously working fine:
>
> Exception in thread "Thread-0" java.lang.ClassCastException:
> java.lang.String cannot be cast to scala.continuations.ControlContext
> at swarm.Ref$$anonfun$apply$2.apply(Ref.scala:10)
> at swarm.Ref$$anonfun$apply$2.apply(Ref.scala:10)
> at scala.continuations.ControlContext$$anonfun$flatMap$1$$anonfun
> $apply$2.apply(ControlContext.scala:27)
> at scala.continuations.ControlContext$$anonfun$shiftUnitR
> $1.apply(ControlContext.scala:85)
> at scala.continuations.ControlContext$$anonfun$shiftUnitR
> $1.apply(ControlContext.scala:85)
> at scala.continuations.ControlContext$$anonfun$flatMap$1$$anonfun
> $apply$2.apply(ControlContext.scala:27)
> at swarm.Swarm$$anon$1$$anonfun$run$1.apply(Swarm.scala:39)
> at swarm.Swarm$$anon$1$$anonfun$run$1.apply(Swarm.scala:39)
> at swarm.Swarm$$anonfun$run$2.apply(Swarm.scala:51)
> at swarm.Swarm$$anonfun$run$2.apply(Swarm.scala:49)
> at scala.continuations.ControlContext$.reifyR(ControlContext.scala:
> 93)
> at scala.continuations.ControlContext$.reset(ControlContext.scala:61)
> at swarm.Swarm$.run(Swarm.scala:49)
> at swarm.Swarm$$anon$1.run(Swarm.scala:39)
>
> Since I'm not casting anything, I assume this is something to-do with
> the plugin - here is the file:
>
> http://github.com/sanity/Swarm/blob/78426cb5cd4136975d9809dc87ffe4d3157f...
>
> I'd appreciate it if you could take a look.
>
> Ian.
>