Skip to content

Commit f876f26

Browse files
committed
Add a feature flag for DisableActorInferenceFromPropertyWrapperUsage.
This will be enabled by default in Swift 6, but can now also be enabled by passing `-enable-upcoming-feature DisableActorInferenceFromPropertyWrapperUsage` to the compiler.
1 parent bf472c2 commit f876f26

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
9797
UPCOMING_FEATURE(ForwardTrailingClosures, 286, 6)
9898
UPCOMING_FEATURE(BareSlashRegexLiterals, 354, 6)
9999
UPCOMING_FEATURE(ExistentialAny, 335, 6)
100+
UPCOMING_FEATURE(DisableActorInferenceFromPropertyWrapperUsage, 0, 6)
100101

101102
EXPERIMENTAL_FEATURE(StaticAssert, false)
102103
EXPERIMENTAL_FEATURE(VariadicGenerics, false)

lib/AST/ASTPrinter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,6 +3170,10 @@ static bool usesFeatureBuiltinMacros(Decl *decl) {
31703170
return false;
31713171
}
31723172

3173+
static bool usesFeatureDisableActorInferenceFromPropertyWrapperUsage(Decl *decl) {
3174+
return false;
3175+
}
3176+
31733177
static void
31743178
suppressingFeatureNoAsyncAvailability(PrintOptions &options,
31753179
llvm::function_ref<void()> action) {

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3451,7 +3451,7 @@ static Optional<ActorIsolation> getIsolationFromWrappers(
34513451
return None;
34523452

34533453
ASTContext &ctx = nominal->getASTContext();
3454-
if (ctx.isSwiftVersionAtLeast(6)) {
3454+
if (ctx.LangOpts.hasFeature(Feature::DisableActorInferenceFromPropertyWrapperUsage)) {
34553455
// In Swift 6, we no longer infer isolation of a nominal type
34563456
// based on the property wrappers used in its stored properties
34573457
return None;

0 commit comments

Comments
 (0)