Skip to content

Commit be38163

Browse files
committed
[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 6f6546e.
1 parent 290c3be commit be38163

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/test/scala/scala/async/run/toughtype/ToughType.scala

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,34 @@ class ToughTypeSpec {
184184
}
185185
Bippy
186186
}
187+
188+
@Test
189+
def ticket63(): Unit = {
190+
import scala.async.Async._
191+
import scala.concurrent.{ ExecutionContext, Future }
192+
193+
object SomeExecutionContext extends ExecutionContext {
194+
def reportFailure(t: Throwable): Unit = ???
195+
def execute(runnable: Runnable): Unit = ???
196+
}
197+
198+
trait FunDep[W, S, R] {
199+
def method(w: W, s: S): Future[R]
200+
}
201+
202+
object FunDep {
203+
implicit def `Something to do with List`[W, S, R](implicit funDep: FunDep[W, S, R]) =
204+
new FunDep[W, List[S], W] {
205+
def method(w: W, l: List[S]) = async {
206+
val it = l.iterator
207+
while (it.hasNext) {
208+
await(funDep.method(w, it.next()))
209+
}
210+
w
211+
}(SomeExecutionContext)
212+
}
213+
}
214+
}
187215
}
188216

189217
trait A

0 commit comments

Comments
 (0)