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

Yet another continuations question!

1 reply
Ian Clarke
Joined: 2008-12-18,
User offline. Last seen 42 years 45 weeks ago.

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.

Tiark Rompf
Joined: 2009-02-18,
User offline. Last seen 42 years 45 weeks ago.
Re: Yet another continuations question!

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.
>

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