aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-03-12 10:36:36 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-03-12 10:50:05 +0100
commitbe38163e9fbf18512d1931b044a43db9c9386b36 (patch)
treee3e804fbadf837d5f9abceee5864844da57d5aa1
parent290c3be6db3ef82e61ea51f789353fef826bfa56 (diff)
downloadscala-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.scala28
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