Skip to content

Commit 0e71623

Browse files
committed
[SE-0411] Promote IsolatedDefaultValues from an experimental feature to an
upcoming feature.
1 parent 4c604b4 commit 0e71623

7 files changed

+14
-15
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ UPCOMING_FEATURE(DeprecateApplicationMain, 383, 6)
120120
UPCOMING_FEATURE(ImportObjcForwardDeclarations, 384, 6)
121121
UPCOMING_FEATURE(DisableOutwardActorInference, 401, 6)
122122
UPCOMING_FEATURE(InternalImportsByDefault, 409, 6)
123+
UPCOMING_FEATURE(IsolatedDefaultValues, 411, 6)
123124
UPCOMING_FEATURE(GlobalConcurrency, 412, 6)
124125
UPCOMING_FEATURE(FullTypedThrows, 413, 6)
125126

@@ -218,9 +219,6 @@ EXPERIMENTAL_FEATURE(StrictConcurrency, true)
218219
/// Region Based Isolation testing using the TransferNonSendable pass
219220
EXPERIMENTAL_FEATURE(RegionBasedIsolation, false)
220221

221-
/// Allow default values to require isolation at the call-site.
222-
EXPERIMENTAL_FEATURE(IsolatedDefaultValues, false)
223-
224222
/// Enable extended callbacks (with additional parameters) to be used when the
225223
/// "playground transform" is enabled.
226224
EXPERIMENTAL_FEATURE(PlaygroundExtendedCallbacks, true)

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
880880
if (Opts.hasFeature(Feature::CompleteConcurrency)) {
881881
Opts.StrictConcurrencyLevel = StrictConcurrency::Complete;
882882
Opts.enableFeature(Feature::DisableOutwardActorInference);
883+
Opts.enableFeature(Feature::IsolatedDefaultValues);
883884
Opts.enableFeature(Feature::GlobalConcurrency);
884885
}
885886

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 RegionBasedIsolation %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 RegionBasedIsolation %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 RegionBasedIsolation -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 RegionBasedIsolation -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 RegionBasedIsolation %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 RegionBasedIsolation %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)