Skip to content

Commit ecb2eb7

Browse files
bjhomerDougGregor
authored andcommitted
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. (cherry picked from commit f876f26)
1 parent 09db52b commit ecb2eb7

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
@@ -113,6 +113,7 @@ UPCOMING_FEATURE(ForwardTrailingClosures, 286, 6)
113113
UPCOMING_FEATURE(BareSlashRegexLiterals, 354, 6)
114114
UPCOMING_FEATURE(ExistentialAny, 335, 6)
115115
UPCOMING_FEATURE(ImportObjcForwardDeclarations, 384, 6)
116+
UPCOMING_FEATURE(DisableActorInferenceFromPropertyWrapperUsage, 0, 6)
116117

117118
EXPERIMENTAL_FEATURE(StaticAssert, false)
118119
EXPERIMENTAL_FEATURE(NamedOpaqueTypes, false)

lib/AST/ASTPrinter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,10 @@ static bool usesFeatureFreestandingExpressionMacros(Decl *decl) {
33463346
return macro->getMacroRoles().contains(MacroRole::Expression);
33473347
}
33483348

3349+
static bool usesFeatureDisableActorInferenceFromPropertyWrapperUsage(Decl *decl) {
3350+
return false;
3351+
}
3352+
33493353
static void
33503354
suppressingFeatureNoAsyncAvailability(PrintOptions &options,
33513355
llvm::function_ref<void()> action) {

lib/Sema/TypeCheckConcurrency.cpp

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

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

0 commit comments

Comments
 (0)