You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classUi[+A](protectedvalv: () ⇒A) {
/** Run the code on the UI thread */defrun:Future[A] = ...
/** Get the result of executing the code on the current thread */defget:A= ...
}
traitCanSnail[W, S, R] {
defsnail(w: W, s: S):Ui[Future[R]]
}
implicitdef`List is snailable`[W, S, R](implicitcanSnail: CanSnail[W, S, R]) =newCanSnail[List[W], S, List[W]] {
defsnail(l: List[W], s: S) =Ui(async {
valit= l.iterator
while (it.hasNext) {
// we can call Ui.get, since we are already inside the UI thread
await(canSnail.snail(it.next(), s).get)
}
l
}(UiThreadExecutionContext))
}
On Scala 2.11.0-RC1 (but not 2.10.3) it fails with
scala.ScalaReflectionException: type R is not a class
[error] at scala.reflect.api.Symbols$SymbolApi$class.asClass(Symbols.scala:272)
[error] at scala.reflect.internal.Symbols$SymbolContextApiImpl.asClass(Symbols.scala:82)
[error] at scala.async.internal.LiveVariables$$anonfun$3.apply(LiveVariables.scala:58)
[error] at scala.async.internal.LiveVariables$$anonfun$3.apply(LiveVariables.scala:57)
[error] at scala.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:259)
[error] at scala.collection.immutable.Set$Set2.foreach(Set.scala:113)
[error] at scala.collection.TraversableLike$class.filterImpl(TraversableLike.scala:258)
[error] at scala.collection.TraversableLike$class.filter(TraversableLike.scala:270)
[error] at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
[error] at scala.async.internal.LiveVariables$class.liveVars(LiveVariables.scala:57)
[error] at scala.async.internal.AsyncMacro$$anon$1.liveVars(AsyncMacro.scala:6)
[error] at scala.async.internal.LiveVariables$class.fieldsToNullOut(LiveVariables.scala:20)
[error] at scala.async.internal.AsyncMacro$$anon$1.fieldsToNullOut(AsyncMacro.scala:6)
[error] at scala.async.internal.AsyncTransform$class.asyncTransform(AsyncTransform.scala:76)
[error] at scala.async.internal.AsyncMacro$$anon$1.asyncTransform(AsyncMacro.scala:6)
[error] at scala.async.internal.AsyncBase.asyncImpl(AsyncBase.scala:48)
[error] at scala.async.internal.ScalaConcurrentAsync$.asyncImpl(ScalaConcurrentAsync.scala:16)
[error] }(UiThreadExecutionContext))
[error] ^
I’m using async milestone M5 on both. Perhaps a regression somewhere?
I’ll be able to push the complete code tomorrow, if that’s necessary.
Nick
The text was updated successfully, but these errors were encountered:
Hi,
I have roughly the following things:
On Scala
2.11.0-RC1
(but not2.10.3
) it fails withI’m using
async
milestoneM5
on both. Perhaps a regression somewhere?I’ll be able to push the complete code tomorrow, if that’s necessary.
Nick
The text was updated successfully, but these errors were encountered: