Skip to content

Untranslated await in string switch with async guard #126

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

Draft
wants to merge 1 commit into
base: 2.12.x
Choose a base branch
from
Draft
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
26 changes: 26 additions & 0 deletions test/junit/scala/tools/nsc/async/AnnotationDrivenAsync.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,32 @@ import scala.tools.nsc.transform.TypingTransformers
import scala.tools.partest.async.AsyncStateMachine

class AnnotationDrivenAsync {
@Test
def testStringSwitchAsyncBug(): Unit = {
val code =
"""
|import scala.tools.nsc.async.{autoawait, customAsync}
|
|
|object Test {
| def log[A](a: A) = a
| @autoawait
| def bar = 42
|
| @autoawait
| def test = {
| toString match {
| case "a" => log("A")
| case "b" => log("B")
| case "c" if bar.toString == "" => log("c")
| case _ =>
| log(("_", bar))
| }
| }
|}
|""".stripMargin
assertEquals((), run(code))
}
@Test
@Ignore // TODO XASYNC
def testBoxedUnitNotImplemented(): Unit = {
Expand Down