We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 792b517 commit e1a1859Copy full SHA for e1a1859
scala-libraries-4/src/test/scala/com/baeldung/scala/async/ScalaAsyncTest.scala
@@ -31,13 +31,19 @@ object ScalaAsyncTest {
31
await(r1) + await(r2)
32
}
33
34
- /*def invalid = async {
+ /* Uncommenting this snippet will produce the following error:
35
+ await must not be used under a nested method. await(slowComputation)
36
+
37
+ def invalid = async {
38
def localFunction = {
39
await(slowComputation)
40
41
42
localFunction
- }
43
+ }*/
44
45
46
+ await must not be used under a try/catch. await(slowComputation)
47
48
def tryCatch = async {
49
try {
0 commit comments