Skip to content

Avoid NotImplementedError awaiting a Future[Nothing] #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/main/scala/scala/async/internal/Lifter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ trait Lifter {
sym.setFlag(MUTABLE | STABLE | PRIVATE | LOCAL)
sym.name = name.fresh(sym.name.toTermName)
sym.modifyInfo(_.deconst)
val zeroRhs = atPos(t.pos)(gen.mkZero(vd.symbol.info))
treeCopy.ValDef(vd, Modifiers(sym.flags), sym.name, TypeTree(sym.tpe).setPos(t.pos), zeroRhs)
treeCopy.ValDef(vd, Modifiers(sym.flags), sym.name, TypeTree(sym.tpe).setPos(t.pos), EmptyTree)
case dd@DefDef(_, _, tparams, vparamss, tpt, rhs) =>
sym.name = this.name.fresh(sym.name.toTermName)
sym.setFlag(PRIVATE | LOCAL)
Expand Down
16 changes: 16 additions & 0 deletions src/test/scala/scala/async/run/toughtype/ToughType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,22 @@ class ToughTypeSpec {
}(SomeExecutionContext)
}
}

}

@Test def ticket66Nothing() {
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
val e = new Exception()
val f: Future[Nothing] = Future.failed(e)
val f1 = async {
await(f)
}
try {
Await.result(f1, 5.seconds)
} catch {
case `e` =>
}
}
}

Expand Down