File tree 4 files changed +148
-0
lines changed
4 files changed +148
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // It is an error for an `async*` function to have return type `void`.
6
+
7
+ import 'dart:async' ;
8
+
9
+ /*space*/ void f1 () async * {
10
+ // ^^^^
11
+ // [analyzer] unspecified
12
+ // [cfe] unspecified
13
+ }
14
+
15
+ class C {
16
+ static void f2 () async * {
17
+ // ^^^^
18
+ // [analyzer] unspecified
19
+ // [cfe] unspecified
20
+ }
21
+
22
+ /*space*/ void f3 () async * {
23
+ // ^^^^
24
+ // [analyzer] unspecified
25
+ // [cfe] unspecified
26
+ }
27
+ }
28
+
29
+ void main () {
30
+ /*space*/ void f4 () async * {
31
+ // ^^^^
32
+ // [analyzer] unspecified
33
+ // [cfe] unspecified
34
+ }
35
+
36
+ // No function literal: It is probably not possible to infer the
37
+ // return type `void` for a function literal marked `async*`.
38
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // It is an error for a `sync*` function to have return type `void`.
6
+
7
+ /*space*/ void f1 () sync * {
8
+ // ^^^^
9
+ // [analyzer] unspecified
10
+ // [cfe] unspecified
11
+ }
12
+
13
+ class C {
14
+ static void f2 () sync * {
15
+ // ^^^^
16
+ // [analyzer] unspecified
17
+ // [cfe] unspecified
18
+ }
19
+
20
+ /*space*/ void f3 () sync * {
21
+ // ^^^^
22
+ // [analyzer] unspecified
23
+ // [cfe] unspecified
24
+ }
25
+ }
26
+
27
+ void main () {
28
+ /*space*/ void f4 () sync * {
29
+ // ^^^^
30
+ // [analyzer] unspecified
31
+ // [cfe] unspecified
32
+ }
33
+
34
+ // No function literal: It is probably not possible to infer the
35
+ // return type `void` for a function literal marked `sync*`.
36
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // It is an error for an `async*` function to have return type `void`.
6
+
7
+ import 'dart:async' ;
8
+
9
+ /*space*/ void f1 () async * {
10
+ // ^^^^
11
+ // [analyzer] unspecified
12
+ // [cfe] unspecified
13
+ }
14
+
15
+ class C {
16
+ static void f2 () async * {
17
+ // ^^^^
18
+ // [analyzer] unspecified
19
+ // [cfe] unspecified
20
+ }
21
+
22
+ /*space*/ void f3 () async * {
23
+ // ^^^^
24
+ // [analyzer] unspecified
25
+ // [cfe] unspecified
26
+ }
27
+ }
28
+
29
+ void main () {
30
+ /*space*/ void f4 () async * {
31
+ // ^^^^
32
+ // [analyzer] unspecified
33
+ // [cfe] unspecified
34
+ }
35
+
36
+ // No function literal: It is probably not possible to infer the
37
+ // return type `void` for a function literal marked `async*`.
38
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // It is an error for a `sync*` function to have return type `void`.
6
+
7
+ /*space*/ void f1 () sync * {
8
+ // ^^^^
9
+ // [analyzer] unspecified
10
+ // [cfe] unspecified
11
+ }
12
+
13
+ class C {
14
+ static void f2 () sync * {
15
+ // ^^^^
16
+ // [analyzer] unspecified
17
+ // [cfe] unspecified
18
+ }
19
+
20
+ /*space*/ void f3 () sync * {
21
+ // ^^^^
22
+ // [analyzer] unspecified
23
+ // [cfe] unspecified
24
+ }
25
+ }
26
+
27
+ void main () {
28
+ /*space*/ void f4 () sync * {
29
+ // ^^^^
30
+ // [analyzer] unspecified
31
+ // [cfe] unspecified
32
+ }
33
+
34
+ // No function literal: It is probably not possible to infer the
35
+ // return type `void` for a function literal marked `sync*`.
36
+ }
You can’t perform that action at this time.
0 commit comments