Skip to content

Commit

Permalink
#2398. Remove excessive async. Add explicit void (#2400)
Browse files Browse the repository at this point in the history
Remove excessive `async`. Add an explicit return type in declarations of `main` that had none.
  • Loading branch information
sgrekhov committed Nov 30, 2023
1 parent aab1a55 commit ad4f95c
Show file tree
Hide file tree
Showing 617 changed files with 618 additions and 620 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import "../../Utils/expect.dart";

main() async {
main() {
bool b = true;
List<int> collection = [9, 8, 7, 6];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ List<dynamic> test7() => [
// [analyzer] unspecified
// [cfe] unspecified

main() async {
main() {
test1();
test2();
test3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Map<String, dynamic> test7() => {
// [cfe] unspecified
};

main() async {
main() {
test1();
test2();
test3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Set<dynamic> test7() => {
// [cfe] unspecified
};

main() async {
main() {
test1();
test2();
test3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Future<List<int>> test6() async {
// [cfe] unspecified
}

main() async {
main() {
test1();
test2();
test3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Future<Map<String, int>> test6() async {
// [cfe] unspecified
}

main() async {
main() {
test1();
test2();
test3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Future<Set<int>> test6() async {
// [cfe] unspecified
}

main() async {
main() {
test1();
test2();
test3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test7() {
}
}

main() async {
main() {
test1();
test2();
test3();
Expand Down
3 changes: 1 addition & 2 deletions LanguageFeatures/nnbd/static_errors_A21_t07.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
/// element in a collection literal
/// @author sgrekhov@unipro.ru

main() async {
main() {
List list = [1, 2, 3, 4];
<int> [
1, 2, 3,
Expand Down
2 changes: 1 addition & 1 deletion LanguageFeatures/nnbd/static_errors_A22_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Future<int> init() async {
return await 42;
}

main() async {
main() {
late Future<int> i = init();
test();
C.sTest();
Expand Down
2 changes: 1 addition & 1 deletion LanguageFeatures/nnbd/weak/static_errors_A22_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Future<int> init() async {
return await 42;
}

main() async {
main() {
late Future<int> i = init();
test();
C.sTest();
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/Directory.fromUri_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
// test existing Directory
Uri uri = new Uri.directory(tmp.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/Directory_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir = new Directory(tmp.path);
Expect.equals(tmp.path, dir.absolute.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/Directory_A02_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
File file = getTempFileSync(parent: sandbox);
Directory dir = new Directory(file.path);
Expect.equals(file.path, dir.absolute.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/absolute_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir =
new Directory(tmp.path + Platform.pathSeparator + "TestDir");
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/absolute_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir =
new Directory(tmp.path + Platform.pathSeparator + "TestDir");
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createSync_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir =
new Directory(tmp.path + Platform.pathSeparator + getTempDirectoryName());
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createSync_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir = new Directory(tmp.path + Platform.pathSeparator + "TestDir");
dir.createSync();
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createSync_A02_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir = new Directory(tmp.path + Platform.pathSeparator + "TestDir");
dir.createSync();
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createSync_A03_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory tmp = getTempDirectorySync(parent: sandbox);
Directory dir1 =
new Directory(tmp.path + Platform.pathSeparator + getTempDirectoryName());
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createTempSync_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory parent = getTempDirectorySync(parent: sandbox);
Directory dir = parent.createTempSync();
Expect.equals(parent.path, dir.parent.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createTempSync_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory parent = getTempDirectorySync(parent: sandbox);
Directory dir = parent.createTempSync("co19");
Expect.equals(parent.path, dir.parent.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createTemp_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
asyncStart();
Directory parent = getTempDirectorySync(parent: sandbox);
await parent.createTemp().then((dir) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/createTemp_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
asyncStart();
Directory parent = getTempDirectorySync(parent: sandbox);
await parent.createTemp("co19").then((dir) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/create_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
asyncStart();
Directory dir = new Directory(getTempDirectoryPath(parent: sandbox));
await dir.create().then((created) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/create_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
asyncStart();
Directory dir = getTempDirectorySync(parent: sandbox);
await dir.create().then((created) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/create_A03_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
asyncStart();
Directory tmp = new Directory(getTempDirectoryPath(parent: sandbox));
Directory dir = new Directory(getTempDirectoryPath(parent: tmp));
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory dir = getTempDirectorySync(parent: sandbox);
dir.deleteSync();
Expect.isFalse(dir.existsSync());
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory dir = getTempDirectorySync(parent: sandbox);
Directory sub = dir.createTempSync();
dir.deleteSync(recursive: true);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A02_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory dir = getTempDirectorySync(parent: sandbox);
Directory sub = dir.createTempSync();
Expect.throws(() {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A02_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory target = getTempDirectorySync(parent: sandbox);
Link link = getTempLinkSync(target: target.path, parent: sandbox);
Directory dir = new Directory(link.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A02_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
File file = getTempFileSync(parent: sandbox);
Directory dir = new Directory(file.path);
dir.deleteSync(recursive: true);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A02_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
File file = getTempFileSync(parent: sandbox);
Directory dir = new Directory(file.path);
bool thrown = false;
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A02_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Link link = getTempLinkSync(parent: sandbox);
Directory dir = new Directory(link.path);
bool thrown = false;
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/deleteSync_A03_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory dir = getTempDirectorySync(parent: sandbox);
dir.deleteSync();
Expect.throws(() {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
Directory dir = getTempDirectorySync(parent: sandbox);
asyncStart();
await dir.delete().then((deleted) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
Directory dir = getTempDirectorySync(parent: sandbox);
Directory sub = dir.createTempSync();

Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A02_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
Directory dir = getTempDirectorySync(parent: sandbox);
Directory sub = dir.createTempSync();

Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A02_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
Directory target = getTempDirectorySync(parent: sandbox);
Link link = getTempLinkSync(target: target.path, parent: sandbox);
Directory dir = new Directory(link.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A02_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
File file = getTempFileSync(parent: sandbox);
Directory dir = new Directory(file.path);

Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A02_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
Directory target = getTempDirectorySync(parent: sandbox);
Link link = getTempLinkSync(target: target.path, parent: sandbox);
Directory dir = new Directory(link.path);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A02_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
File file = getTempFileSync(parent: sandbox);
Directory dir = new Directory(file.path);

Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/delete_A03_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) async {
Directory dir = getTempDirectorySync(parent: sandbox);
dir.deleteSync();

Expand Down
2 changes: 1 addition & 1 deletion LibTest/io/Directory/existsSync_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main() async {
await inSandbox(_main);
}

_main(Directory sandbox) async {
void _main(Directory sandbox) {
Directory dir = getTempDirectorySync(parent: sandbox);
Expect.isTrue(dir.existsSync());
}

0 comments on commit ad4f95c

Please sign in to comment.