Skip to content

Commit cf19f02

Browse files
committed
Incorporate pull request feedback
- remove unneeded `setType(NoType)`, which was leftover from my first attempts to find this bug. - fix typo in error message - optimize imports (cherry picked from commit 5c6ea29)
1 parent ee66e08 commit cf19f02

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

src/main/scala/scala/async/internal/AsyncAnalysis.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ trait AsyncAnalysis {
6161
case Return(_) =>
6262
abort(tree.pos, "return is illegal within a async block")
6363
case DefDef(mods, _, _, _, _, _) if mods.hasFlag(Flag.LAZY) && containsAwait =>
64-
reportUnsupportedAwait(tree, "lazy val initalizer")
64+
reportUnsupportedAwait(tree, "lazy val initializer")
6565
case CaseDef(_, guard, _) if guard exists isAwait =>
6666
// TODO lift this restriction
6767
reportUnsupportedAwait(tree, "pattern guard")

src/main/scala/scala/async/internal/AsyncTransform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ trait AsyncTransform {
5252
}
5353

5454
val tryToUnit = appliedType(definitions.FunctionClass(1), futureSystemOps.tryType[Any], typeOf[Unit])
55-
val template = Template(List(tryToUnit, typeOf[() => Unit]).map(TypeTree(_)), emptyValDef, body).setType(NoType)
55+
val template = Template(List(tryToUnit, typeOf[() => Unit]).map(TypeTree(_)), emptyValDef, body)
5656

5757
val t = ClassDef(NoMods, name.stateMachineT, Nil, template)
5858
typecheckClassDef(t)

src/test/scala/scala/async/neg/NakedAwait.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class NakedAwait {
163163

164164
@Test
165165
def lazyValIllegal() {
166-
expectError("await must not be used under a lazy val initalizer") {
166+
expectError("await must not be used under a lazy val initializer") {
167167
"""
168168
| import _root_.scala.async.internal.AsyncId._
169169
| def foo(): Any = async { val x = { lazy val y = await(0); y } }

src/test/scala/scala/async/run/lazyval/LazyValSpec.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ package scala.async
66
package run
77
package lazyval
88

9-
import scala.async.run.noawait
10-
11-
import scala.async.internal.AsyncId
12-
import scala.async.internal.AsyncId
13-
import AsyncId._
149
import org.junit.Test
1510
import scala.async.internal.AsyncId._
1611

0 commit comments

Comments
 (0)