Skip to content

Commit 6d18260

Browse files
committed
Add test for non-concurrency async-main
This patch adds a quick test to verify that we emit a reasonable error message when trying to use async-main without enabling concurrency or parsing as stdlib instead of crashing. Under both circumstances, the _Concurrency library won't be implicitly imported.
1 parent 638a5b6 commit 6d18260

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-typecheck-verify-swift -parse-as-library %s
2+
// RUN: %target-typecheck-verify-swift -parse-as-library -enable-experimental-concurrency -parse-stdlib %s
3+
4+
@main struct Main {
5+
// expected-error@+1:22{{'_Concurrency' module not imported, required for async main}}
6+
static func main() async {
7+
}
8+
}

0 commit comments

Comments
 (0)