@@ -9,7 +9,7 @@ import org.junit.Test
9
9
10
10
class NakedAwait {
11
11
@ Test
12
- def `await only allowed in async neg` () {
12
+ def `await only allowed in async neg` (): Unit = {
13
13
expectError(" `await` must be enclosed in an `async` block" ) {
14
14
"""
15
15
| import _root_.scala.async.Async._
@@ -19,7 +19,7 @@ class NakedAwait {
19
19
}
20
20
21
21
@ Test
22
- def `await not allowed in by-name argument` () {
22
+ def `await not allowed in by-name argument` (): Unit = {
23
23
expectError(" await must not be used under a by-name argument." ) {
24
24
"""
25
25
| import _root_.scala.async.internal.AsyncId._
@@ -30,7 +30,7 @@ class NakedAwait {
30
30
}
31
31
32
32
@ Test
33
- def `await not allowed in boolean short circuit argument 1` () {
33
+ def `await not allowed in boolean short circuit argument 1` (): Unit = {
34
34
expectError(" await must not be used under a by-name argument." ) {
35
35
"""
36
36
| import _root_.scala.async.internal.AsyncId._
@@ -40,7 +40,7 @@ class NakedAwait {
40
40
}
41
41
42
42
@ Test
43
- def `await not allowed in boolean short circuit argument 2` () {
43
+ def `await not allowed in boolean short circuit argument 2` (): Unit = {
44
44
expectError(" await must not be used under a by-name argument." ) {
45
45
"""
46
46
| import _root_.scala.async.internal.AsyncId._
@@ -50,7 +50,7 @@ class NakedAwait {
50
50
}
51
51
52
52
@ Test
53
- def nestedObject () {
53
+ def nestedObject (): Unit = {
54
54
expectError(" await must not be used under a nested object." ) {
55
55
"""
56
56
| import _root_.scala.async.internal.AsyncId._
@@ -60,7 +60,7 @@ class NakedAwait {
60
60
}
61
61
62
62
@ Test
63
- def nestedTrait () {
63
+ def nestedTrait (): Unit = {
64
64
expectError(" await must not be used under a nested trait." ) {
65
65
"""
66
66
| import _root_.scala.async.internal.AsyncId._
@@ -70,7 +70,7 @@ class NakedAwait {
70
70
}
71
71
72
72
@ Test
73
- def nestedClass () {
73
+ def nestedClass (): Unit = {
74
74
expectError(" await must not be used under a nested class." ) {
75
75
"""
76
76
| import _root_.scala.async.internal.AsyncId._
@@ -80,7 +80,7 @@ class NakedAwait {
80
80
}
81
81
82
82
@ Test
83
- def nestedFunction () {
83
+ def nestedFunction (): Unit = {
84
84
expectError(" await must not be used under a nested function." ) {
85
85
"""
86
86
| import _root_.scala.async.internal.AsyncId._
@@ -90,7 +90,7 @@ class NakedAwait {
90
90
}
91
91
92
92
@ Test
93
- def nestedPatMatFunction () {
93
+ def nestedPatMatFunction (): Unit = {
94
94
expectError(" await must not be used under a nested class." ) { // TODO more specific error message
95
95
"""
96
96
| import _root_.scala.async.internal.AsyncId._
@@ -100,7 +100,7 @@ class NakedAwait {
100
100
}
101
101
102
102
@ Test
103
- def tryBody () {
103
+ def tryBody (): Unit = {
104
104
expectError(" await must not be used under a try/catch." ) {
105
105
"""
106
106
| import _root_.scala.async.internal.AsyncId._
@@ -110,7 +110,7 @@ class NakedAwait {
110
110
}
111
111
112
112
@ Test
113
- def catchBody () {
113
+ def catchBody (): Unit = {
114
114
expectError(" await must not be used under a try/catch." ) {
115
115
"""
116
116
| import _root_.scala.async.internal.AsyncId._
@@ -120,7 +120,7 @@ class NakedAwait {
120
120
}
121
121
122
122
@ Test
123
- def finallyBody () {
123
+ def finallyBody (): Unit = {
124
124
expectError(" await must not be used under a try/catch." ) {
125
125
"""
126
126
| import _root_.scala.async.internal.AsyncId._
@@ -130,7 +130,7 @@ class NakedAwait {
130
130
}
131
131
132
132
@ Test
133
- def guard () {
133
+ def guard (): Unit = {
134
134
expectError(" await must not be used under a pattern guard." ) {
135
135
"""
136
136
| import _root_.scala.async.internal.AsyncId._
@@ -140,7 +140,7 @@ class NakedAwait {
140
140
}
141
141
142
142
@ Test
143
- def nestedMethod () {
143
+ def nestedMethod (): Unit = {
144
144
expectError(" await must not be used under a nested method." ) {
145
145
"""
146
146
| import _root_.scala.async.internal.AsyncId._
@@ -150,7 +150,7 @@ class NakedAwait {
150
150
}
151
151
152
152
@ Test
153
- def returnIllegal () {
153
+ def returnIllegal (): Unit = {
154
154
expectError(" return is illegal" ) {
155
155
"""
156
156
| import _root_.scala.async.internal.AsyncId._
@@ -162,7 +162,7 @@ class NakedAwait {
162
162
}
163
163
164
164
@ Test
165
- def lazyValIllegal () {
165
+ def lazyValIllegal (): Unit = {
166
166
expectError(" await must not be used under a lazy val initializer" ) {
167
167
"""
168
168
| import _root_.scala.async.internal.AsyncId._
0 commit comments