Skip to content

Remove left-overs of CPS fallback logic #38

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
Nov 7, 2013
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
6 changes: 2 additions & 4 deletions src/main/scala/scala/async/internal/AsyncBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ abstract class AsyncBase {
@compileTimeOnly("`await` must be enclosed in an `async` block")
def await[T](awaitable: futureSystem.Fut[T]): T = ???

protected[async] def fallbackEnabled = false

def asyncImpl[T: c.WeakTypeTag](c: Context)
(body: c.Expr[T])
(execContext: c.Expr[futureSystem.ExecContext]): c.Expr[futureSystem.Fut[T]] = {
Expand All @@ -50,8 +48,8 @@ abstract class AsyncBase {

val code = asyncMacro.asyncTransform[T](
body.tree.asInstanceOf[asyncMacro.global.Tree],
execContext.tree.asInstanceOf[asyncMacro.global.Tree],
fallbackEnabled)(implicitly[c.WeakTypeTag[T]].asInstanceOf[asyncMacro.global.WeakTypeTag[T]]).asInstanceOf[Tree]
execContext.tree.asInstanceOf[asyncMacro.global.Tree]
)(implicitly[c.WeakTypeTag[T]].asInstanceOf[asyncMacro.global.WeakTypeTag[T]]).asInstanceOf[Tree]

// Mark range positions for synthetic code as transparent to allow some wiggle room for overlapping ranges
for (t <- code)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/async/internal/AsyncTransform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait AsyncTransform {

val asyncBase: AsyncBase

def asyncTransform[T](body: Tree, execContext: Tree, cpsFallbackEnabled: Boolean)
def asyncTransform[T](body: Tree, execContext: Tree)
(resultType: WeakTypeTag[T]): Tree = {

// We annotate the type of the whole expression as `T @uncheckedBounds` so as not to introduce
Expand Down