Skip to content

Mark await as @compileTimeOnly #12

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
Apr 20, 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
4 changes: 2 additions & 2 deletions src/main/scala/scala/async/Async.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package scala.async

import scala.language.experimental.macros
import scala.reflect.macros.Context
import scala.reflect.internal.annotations.compileTimeOnly

object Async extends AsyncBase {

Expand Down Expand Up @@ -56,8 +57,7 @@ abstract class AsyncBase {
* @tparam T the type of that value.
* @return the value.
*/
// TODO Replace with `@compileTimeOnly when this is implemented SI-6539
@deprecated("`await` must be enclosed in an `async` block", "0.1")
@compileTimeOnly("`await` must be enclosed in an `async` block")
def await[T](awaitable: futureSystem.Fut[T]): T = ???

protected[async] def fallbackEnabled = false
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/scala/async/neg/NakedAwait.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.junit.Test
class NakedAwait {
@Test
def `await only allowed in async neg`() {
expectError("`await` must be enclosed in an `async` block", "-deprecation -Xfatal-warnings") {
expectError("`await` must be enclosed in an `async` block") {
"""
| import _root_.scala.async.Async._
| await[Any](null)
Expand Down