diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-03-12 10:36:36 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-03-12 10:50:05 +0100 |
commit | be38163e9fbf18512d1931b044a43db9c9386b36 (patch) | |
tree | e3e804fbadf837d5f9abceee5864844da57d5aa1 | |
parent | 290c3be6db3ef82e61ea51f789353fef826bfa56 (diff) | |
download | scala-async-be38163e9fbf18512d1931b044a43db9c9386b36.tar.gz scala-async-be38163e9fbf18512d1931b044a43db9c9386b36.tar.bz2 scala-async-be38163e9fbf18512d1931b044a43db9c9386b36.zip |
[backport] Test case for "not a class" crasher in live variable
Works on the 2.10.x branch, so just backprting the test.
Cherry picked from 6f6546ebfc26564843621e79d840209a5103d3c8.
-rw-r--r-- | src/test/scala/scala/async/run/toughtype/ToughType.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/run/toughtype/ToughType.scala b/src/test/scala/scala/async/run/toughtype/ToughType.scala index 6159f7b..458157c 100644 --- a/src/test/scala/scala/async/run/toughtype/ToughType.scala +++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala @@ -184,6 +184,34 @@ class ToughTypeSpec { } Bippy } + + @Test + def ticket63(): Unit = { + import scala.async.Async._ + import scala.concurrent.{ ExecutionContext, Future } + + object SomeExecutionContext extends ExecutionContext { + def reportFailure(t: Throwable): Unit = ??? + def execute(runnable: Runnable): Unit = ??? + } + + trait FunDep[W, S, R] { + def method(w: W, s: S): Future[R] + } + + object FunDep { + implicit def `Something to do with List`[W, S, R](implicit funDep: FunDep[W, S, R]) = + new FunDep[W, List[S], W] { + def method(w: W, l: List[S]) = async { + val it = l.iterator + while (it.hasNext) { + await(funDep.method(w, it.next())) + } + w + }(SomeExecutionContext) + } + } + } } trait A |