diff options
-rw-r--r-- | src/main/scala/scala/async/internal/LiveVariables.scala | 3 | ||||
-rw-r--r-- | src/test/scala/scala/async/run/toughtype/ToughType.scala | 28 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/main/scala/scala/async/internal/LiveVariables.scala b/src/main/scala/scala/async/internal/LiveVariables.scala index 6c67e99..7f386c8 100644 --- a/src/main/scala/scala/async/internal/LiveVariables.scala +++ b/src/main/scala/scala/async/internal/LiveVariables.scala @@ -55,7 +55,8 @@ trait LiveVariables { // determine which fields should be live also at the end (will not be nulled out) val noNull: Set[Symbol] = liftedSyms.filter { sym => - tpe(sym).typeSymbol.asClass.isPrimitive || liftables.exists { tree => + val typeSym = tpe(sym).typeSymbol + (typeSym.isClass && typeSym.asClass.isPrimitive) || liftables.exists { tree => !liftedSyms.contains(tree.symbol) && tree.exists(_.symbol == sym) } } 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 |