Skip to content

Commit 0fb9f4d

Browse files
committed
[SE-0411] Promote IsolatedDefaultValues from an experimental feature to an
upcoming feature. (cherry picked from commit 0e71623)
1 parent 18ba448 commit 0fb9f4d

6 files changed

+13
-15
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ UPCOMING_FEATURE(BareSlashRegexLiterals, 354, 6)
118118
UPCOMING_FEATURE(DeprecateApplicationMain, 383, 6)
119119
UPCOMING_FEATURE(ImportObjcForwardDeclarations, 384, 6)
120120
UPCOMING_FEATURE(DisableOutwardActorInference, 401, 6)
121+
UPCOMING_FEATURE(IsolatedDefaultValues, 411, 6)
121122
UPCOMING_FEATURE(GlobalConcurrency, 412, 6)
122123

123124
UPCOMING_FEATURE(ExistentialAny, 335, 7)
@@ -222,9 +223,6 @@ EXPERIMENTAL_FEATURE(StrictConcurrency, true)
222223
/// Defer Sendable checking to SIL diagnostic phase.
223224
EXPERIMENTAL_FEATURE(SendNonSendable, false)
224225

225-
/// Allow default values to require isolation at the call-site.
226-
EXPERIMENTAL_FEATURE(IsolatedDefaultValues, false)
227-
228226
/// Enable extended callbacks (with additional parameters) to be used when the
229227
/// "playground transform" is enabled.
230228
EXPERIMENTAL_FEATURE(PlaygroundExtendedCallbacks, true)

test/Concurrency/isolated_default_argument_eval.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -I %t -disable-availability-checking -strict-concurrency=complete -enable-experimental-feature IsolatedDefaultValues -parse-as-library %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -I %t -disable-availability-checking -strict-concurrency=complete -enable-upcoming-feature IsolatedDefaultValues -parse-as-library %s | %FileCheck %s
22

33
// REQUIRES: concurrency
44
// REQUIRES: asserts

test/Concurrency/isolated_default_arguments.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/OtherActors.swiftmodule -module-name OtherActors %S/Inputs/OtherActors.swift -disable-availability-checking
44

5-
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -enable-experimental-feature IsolatedDefaultValues -parse-as-library -emit-sil -o /dev/null -verify %s
6-
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -parse-as-library -emit-sil -o /dev/null -verify -enable-experimental-feature IsolatedDefaultValues -enable-experimental-feature SendNonSendable %s
5+
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -enable-upcoming-feature IsolatedDefaultValues -parse-as-library -emit-sil -o /dev/null -verify %s
6+
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -parse-as-library -emit-sil -o /dev/null -verify -enable-upcoming-feature IsolatedDefaultValues -enable-experimental-feature SendNonSendable %s
77

88
// REQUIRES: concurrency
99
// REQUIRES: asserts

test/Concurrency/isolated_default_arguments_serialized.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -swift-version 5 -emit-module-path %t/SerializedDefaultArguments.swiftmodule -module-name SerializedDefaultArguments -enable-experimental-feature IsolatedDefaultValues %S/Inputs/serialized_default_arguments.swift
2+
// RUN: %target-swift-frontend -emit-module -swift-version 5 -emit-module-path %t/SerializedDefaultArguments.swiftmodule -module-name SerializedDefaultArguments -enable-upcoming-feature IsolatedDefaultValues %S/Inputs/serialized_default_arguments.swift
33

44
// RUN: %target-swift-frontend %s -emit-sil -o /dev/null -verify -disable-availability-checking -swift-version 6 -I %t
5-
// RUN: %target-swift-frontend %s -emit-sil -o /dev/null -verify -disable-availability-checking -swift-version 6 -I %t -enable-experimental-feature SendNonSendable -enable-experimental-feature IsolatedDefaultValues
5+
// RUN: %target-swift-frontend %s -emit-sil -o /dev/null -verify -disable-availability-checking -swift-version 6 -I %t -enable-experimental-feature SendNonSendable -enable-upcoming-feature IsolatedDefaultValues
66

77
// REQUIRES: concurrency
88
// REQUIRES: asserts

test/Concurrency/isolated_default_property_inits.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/OtherActors.swiftmodule -module-name OtherActors %S/Inputs/OtherActors.swift -disable-availability-checking
44

5-
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -enable-experimental-feature IsolatedDefaultValues -parse-as-library -emit-sil -o /dev/null -verify %s
6-
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -parse-as-library -emit-sil -o /dev/null -verify -enable-experimental-feature IsolatedDefaultValues -enable-experimental-feature SendNonSendable %s
5+
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -enable-upcoming-feature IsolatedDefaultValues -parse-as-library -emit-sil -o /dev/null -verify %s
6+
// RUN: %target-swift-frontend -I %t -disable-availability-checking -strict-concurrency=complete -parse-as-library -emit-sil -o /dev/null -verify -enable-upcoming-feature IsolatedDefaultValues -enable-experimental-feature SendNonSendable %s
77

88
// REQUIRES: concurrency
99
// REQUIRES: asserts

test/Concurrency/predates_concurrency_swift6.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ func testElsewhere(x: X) {
5959
// expected-note@-1{{are implicitly asynchronous}}
6060

6161
@preconcurrency @MainActor class MyModelClass {
62-
// expected-note@-1{{are implicitly asynchronous}}
6362
func f() { }
6463
// expected-note@-1{{are implicitly asynchronous}}
6564
}
6665

6766
func testCalls(x: X) {
68-
// expected-note@-1 3{{add '@MainActor' to make global function 'testCalls(x:)' part of global actor 'MainActor'}}
67+
// expected-note@-1 2{{add '@MainActor' to make global function 'testCalls(x:)' part of global actor 'MainActor'}}
6968
onMainActorAlways() // expected-error{{call to main actor-isolated global function 'onMainActorAlways()' in a synchronous nonisolated context}}
7069

7170
let _: () -> Void = onMainActorAlways // expected-error{{converting function value of type '@MainActor () -> ()' to '() -> Void' loses global actor 'MainActor'}}
7271

73-
let c = MyModelClass() // expected-error{{call to main actor-isolated initializer 'init()' in a synchronous nonisolated context}}
72+
let c = MyModelClass() // okay, synthesized init() is 'nonisolated'
73+
7474
c.f() // expected-error{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
7575
}
7676

@@ -80,8 +80,8 @@ func testCallsWithAsync() async {
8080

8181
let _: () -> Void = onMainActorAlways // expected-error{{converting function value of type '@MainActor () -> ()' to '() -> Void' loses global actor 'MainActor'}}
8282

83-
let c = MyModelClass() // expected-error{{expression is 'async' but is not marked with 'await'}}
84-
// expected-note@-1{{calls to initializer 'init()' from outside of its actor context are implicitly asynchronous}}
83+
let c = MyModelClass() // okay, synthesized init() is 'nonisolated'
84+
8585
c.f() // expected-error{{expression is 'async' but is not marked with 'await'}}
8686
// expected-note@-1{{calls to instance method 'f()' from outside of its actor context are implicitly asynchronous}}
8787
}

0 commit comments

Comments
 (0)