From be38163e9fbf18512d1931b044a43db9c9386b36 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 12 Mar 2014 10:36:36 +0100 Subject: [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. --- .../scala/async/run/toughtype/ToughType.scala | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 -- cgit v1.2.3