Skip to content

Commit 94ed352

Browse files
authored
Merge pull request #41193 from etcwilde/ewilde/fix-test-failures
Swift 6 mode is only available on asserts builds
2 parents 3308a62 + ffc8511 commit 94ed352

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

test/Concurrency/property_initializers_swift6.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 6 -disable-availability-checking -warn-concurrency
22
// REQUIRES: concurrency
33

4+
// REQUIRES: asserts
45

56
@MainActor
67
func mainActorFn() -> Int { return 0 } // expected-note 2 {{calls to global function 'mainActorFn()' from outside of its actor context are implicitly asynchronous}}

test/Concurrency/toplevel/async-6-top-level.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-frontend -typecheck -disable-availability-checking -enable-experimental-async-top-level -swift-version 6 %s -verify
22

3+
// REQUIRES: asserts
4+
35
var a = 10
46
// expected-note@-1 2 {{var declared here}}
57
// expected-note@-2 2 {{mutation of this var is only permitted within the actor}}

test/Concurrency/toplevel/main.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: not %target-swift-frontend -enable-experimental-async-top-level -swift-version 6 -typecheck %s %S/Inputs/foo.swift 2>&1 | %FileCheck %s --check-prefixes='Swift6-CHECK,CHECK'
22
// RUN: not %target-swift-frontend -enable-experimental-async-top-level -swift-version 5 -typecheck %s %S/Inputs/foo.swift 2>&1 | %FileCheck %s --check-prefixes='Swift5-CHECK,CHECK'
33

4+
// REQUIRES: asserts
5+
46
var a = 10
57

68
@MainActor

test/Concurrency/toplevel/no-async-6-top-level.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-swift-frontend -typecheck -disable-availability-checking -enable-experimental-async-top-level -swift-version 6 %s -verify
22
// RUN: %target-swift-frontend -typecheck -disable-availability-checking -swift-version 6 %s -verify
33

4+
// REQUIRES: asserts
5+
46
// Even though enable-experimental-async-top-level is enabled, there are no
57
// 'await's made from the top-level, thus the top-level is not an asynchronous
68
// context. `a` is just a normal top-level global variable with no actor

0 commit comments

Comments
 (0)