diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index ce3748ccff1..d7fb06863cc 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -5697,8 +5697,6 @@ ERROR(preconcurrency_not_inheritance_clause,none, "'preconcurrency' attribute only applies in inheritance clauses", ()) ERROR(preconcurrency_not_existential,none, "'preconcurrency' attribute cannot apply to non-protocol type %0", (Type)) -ERROR(preconcurrency_attr_disabled,none, - "attribute requires '-enable-experimental-feature DynamicActorIsolation'", ()) ERROR(redundant_any_in_existential,none, "redundant 'any' in type %0", diff --git a/include/swift/Basic/Features.def b/include/swift/Basic/Features.def index a3106b8a881..04ca235e12d 100644 --- a/include/swift/Basic/Features.def +++ b/include/swift/Basic/Features.def @@ -191,6 +191,7 @@ UPCOMING_FEATURE(GlobalConcurrency, 412, 6) UPCOMING_FEATURE(InferSendableFromCaptures, 418, 6) UPCOMING_FEATURE(ImplicitOpenExistentials, 352, 6) UPCOMING_FEATURE(RegionBasedIsolation, 414, 6) +UPCOMING_FEATURE(DynamicActorIsolation, 423, 6) UPCOMING_FEATURE(MoveOnlyPartialConsumption, 429, 6) // Swift 7 @@ -354,11 +355,6 @@ EXPERIMENTAL_FEATURE(GroupActorErrors, true) // Allow for the 'transferring' keyword to be applied to arguments and results. EXPERIMENTAL_FEATURE(TransferringArgsAndResults, true) -// Enable `@preconcurrency` attribute on protocol conformances and runtime checks -// of actor isolation in @obj thunks and arguments of APIs that haven't yet adopted -// strict concurrency checking. -EXPERIMENTAL_FEATURE(DynamicActorIsolation, false) - // Allow for `switch` of noncopyable values to be borrowing or consuming. EXPERIMENTAL_FEATURE(BorrowingSwitch, true) diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index ba3aac31b52..c2805ac1011 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -593,6 +593,9 @@ namespace swift { /// type-checking, SIL verification, and IR emission, bool BypassResilienceChecks = false; + /// Disables `DynamicActorIsolation` feature. + bool DisableDynamicActorIsolation = false; + /// Whether or not to allow experimental features that are only available /// in "production". #ifdef NDEBUG @@ -605,6 +608,11 @@ namespace swift { return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread; } + bool isDynamicActorIsolationCheckingEnabled() const { + return !DisableDynamicActorIsolation && + hasFeature(Feature::DynamicActorIsolation); + } + LangOptions(); /// Sets the target we are building for and updates platform conditions diff --git a/include/swift/Option/Options.td b/include/swift/Option/Options.td index c78a45cd567..3a03eac4e67 100644 --- a/include/swift/Option/Options.td +++ b/include/swift/Option/Options.td @@ -817,6 +817,11 @@ def disable_actor_data_race_checks : Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>, HelpText<"Disable runtime checks for actor data races">; +def disable_dynamic_actor_isolation : + Flag<["-"], "disable-dynamic-actor-isolation">, + Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>, + HelpText<"Disable dynamic actor isolation checks">; + def enable_bare_slash_regex : Flag<["-"], "enable-bare-slash-regex">, Flags<[FrontendOption, ModuleInterfaceOption]>, HelpText<"Enable the use of forward slash regular-expression literal syntax">; diff --git a/lib/AST/FeatureSet.cpp b/lib/AST/FeatureSet.cpp index bb4285e872c..412ffa1c8e6 100644 --- a/lib/AST/FeatureSet.cpp +++ b/lib/AST/FeatureSet.cpp @@ -645,29 +645,7 @@ static bool usesFeatureTransferringArgsAndResults(Decl *decl) { return false; } -static bool usesFeatureDynamicActorIsolation(Decl *decl) { - auto usesPreconcurrencyConformance = [&](const InheritedTypes &inherited) { - return llvm::any_of( - inherited.getEntries(), - [](const InheritedEntry &entry) { return entry.isPreconcurrency(); }); - }; - - if (auto *T = dyn_cast(decl)) - return usesPreconcurrencyConformance(T->getInherited()); - - if (auto *E = dyn_cast(decl)) { - // If type has `@preconcurrency` conformance(s) all of its - // extensions have to be guarded by the flag too. - if (auto *T = dyn_cast(E->getExtendedNominal())) { - if (usesPreconcurrencyConformance(T->getInherited())) - return true; - } - - return usesPreconcurrencyConformance(E->getInherited()); - } - - return false; -} +UNINTERESTING_FEATURE(DynamicActorIsolation) UNINTERESTING_FEATURE(BorrowingSwitch) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 55dfc877f98..a945f376fa3 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -264,6 +264,7 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI, inputArgs.AddLastArg(arguments, options::OPT_enable_actor_data_race_checks, options::OPT_disable_actor_data_race_checks); + inputArgs.AddLastArg(arguments, options::OPT_disable_dynamic_actor_isolation); inputArgs.AddLastArg(arguments, options::OPT_warn_concurrency); inputArgs.AddLastArg(arguments, options::OPT_strict_concurrency); inputArgs.AddAllArgs(arguments, options::OPT_enable_experimental_feature); diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 4b1164d1bb9..131614559d3 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1535,6 +1535,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args, } } + Opts.DisableDynamicActorIsolation |= + Args.hasArg(OPT_disable_dynamic_actor_isolation); + #if SWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION /// Enable round trip parsing via the new swift parser unless it is disabled /// explicitly. The new Swift parser can have mismatches with C++ parser - diff --git a/lib/SILGen/SILGenBridging.cpp b/lib/SILGen/SILGenBridging.cpp index 2871f5739e6..4e9a64da089 100644 --- a/lib/SILGen/SILGenBridging.cpp +++ b/lib/SILGen/SILGenBridging.cpp @@ -1593,14 +1593,12 @@ void SILGenFunction::emitNativeToForeignThunk(SILDeclRef thunk) { loc.markAutoGenerated(); Scope scope(Cleanups, CleanupLocation(loc)); - bool emitExecutorPrecondition = - getASTContext().LangOpts.hasFeature(Feature::DynamicActorIsolation); - std::optional isolation; if (F.isAsync()) { if (thunk.hasDecl()) isolation = getActorIsolation(thunk.getDecl()); - } else if (emitExecutorPrecondition) { + } else if (getASTContext() + .LangOpts.isDynamicActorIsolationCheckingEnabled()) { if (thunk.hasDecl()) { isolation = getActorIsolation(thunk.getDecl()); } else if (auto globalActor = nativeInfo.FormalType->getGlobalActor()) { diff --git a/lib/SILGen/SILGenPoly.cpp b/lib/SILGen/SILGenPoly.cpp index 0117ee68873..724a6df3166 100644 --- a/lib/SILGen/SILGenPoly.cpp +++ b/lib/SILGen/SILGenPoly.cpp @@ -7021,7 +7021,10 @@ void SILGenFunction::emitProtocolWitness( if (!F.isAsync()) { assert(isPreconcurrency); - emitPreconditionCheckExpectedExecutor(loc, *enterIsolation, actorSelf); + + if (getASTContext().LangOpts.isDynamicActorIsolationCheckingEnabled()) { + emitPreconditionCheckExpectedExecutor(loc, *enterIsolation, actorSelf); + } } else { emitHopToTargetActor(loc, enterIsolation, actorSelf); } diff --git a/lib/Sema/CSApply.cpp b/lib/Sema/CSApply.cpp index 2fe49c9baf5..7514b5dff06 100644 --- a/lib/Sema/CSApply.cpp +++ b/lib/Sema/CSApply.cpp @@ -7462,7 +7462,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType, } } - if (ctx.LangOpts.hasFeature(Feature::DynamicActorIsolation)) { + if (ctx.LangOpts.isDynamicActorIsolationCheckingEnabled()) { // Passing a synchronous global actor-isolated function value and // parameter that expects a synchronous non-isolated function type could // require a runtime check to ensure that function is always called in diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index 7dc7f1d7343..24f5b11590b 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -3317,28 +3317,21 @@ TypeResolver::resolveAttributedType(TypeRepr *repr, TypeResolutionOptions option } if (auto preconcurrencyAttr = claim(attrs)) { - auto &ctx = getASTContext(); - if (ctx.LangOpts.hasFeature(Feature::DynamicActorIsolation)) { - if (ty->hasError()) - return ty; + if (ty->hasError()) + return ty; - if (!options.is(TypeResolverContext::Inherited) || - getDeclContext()->getSelfProtocolDecl()) { - diagnoseInvalid(repr, preconcurrencyAttr->getAtLoc(), - diag::preconcurrency_not_inheritance_clause); - ty = ErrorType::get(getASTContext()); - } else if (!ty->isConstraintType()) { - diagnoseInvalid(repr, preconcurrencyAttr->getAtLoc(), - diag::preconcurrency_not_existential, ty); - ty = ErrorType::get(getASTContext()); - } - - // Nothing to record in the type. - } else { + if (!options.is(TypeResolverContext::Inherited) || + getDeclContext()->getSelfProtocolDecl()) { diagnoseInvalid(repr, preconcurrencyAttr->getAtLoc(), - diag::preconcurrency_attr_disabled); + diag::preconcurrency_not_inheritance_clause); + ty = ErrorType::get(getASTContext()); + } else if (!ty->isConstraintType()) { + diagnoseInvalid(repr, preconcurrencyAttr->getAtLoc(), + diag::preconcurrency_not_existential, ty); ty = ErrorType::get(getASTContext()); } + + // Nothing to record in the type. } if (auto retroactiveAttr = claim(attrs)) { diff --git a/test/ClangImporter/preconcurrency_conformances.swift b/test/ClangImporter/preconcurrency_conformances.swift index ddb22be9ef5..c4fc0a00992 100644 --- a/test/ClangImporter/preconcurrency_conformances.swift +++ b/test/ClangImporter/preconcurrency_conformances.swift @@ -1,9 +1,14 @@ -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -enable-experimental-feature DynamicActorIsolation -emit-silgen %s | %FileCheck %s +// RUN: %empty-directory(%t/src) +// RUN: split-file %s %t/src + +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -enable-upcoming-feature DynamicActorIsolation -emit-silgen -module-name preconcurrency_conformances %t/src/checks.swift | %FileCheck %t/src/checks.swift +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -swift-version 6 -disable-dynamic-actor-isolation -emit-silgen -module-name preconcurrency_conformances %t/src/checks_disabled.swift | %FileCheck %t/src/checks_disabled.swift // REQUIRES: asserts // REQUIRES: concurrency // REQUIRES: objc_interop +//--- checks.swift import Foundation actor MyActor { @@ -130,3 +135,77 @@ class Sub : Super { // CHECK-NEXT: [[EXEC:%.*]] = extract_executor [[MAIN_ACTOR]] : $MainActor // CHECK: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () // CHECK-NEXT: {{.*}} = apply [[PRECONDITION]]({{.*}}, [[EXEC]]) : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +//--- checks_disabled.swift +import Foundation + +actor MyActor { +} + +@globalActor +struct GlobalActor { + static let shared: MyActor = MyActor() +} + +@objc protocol P { + var data: String? { get set } + + init() + func test() -> String? +} + +@MainActor +final class K : @preconcurrency P { + var data: String? { + get { nil } + set {} + } + + init() {} + @GlobalActor func test() -> String? { nil } +} + +// @objc K.data.getter +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances1KC4dataSSSgvgTo : $@convention(objc_method) (K) -> @autoreleased Optional +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +// @objc K.data.setter +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances1KC4dataSSSgvsTo : $@convention(objc_method) (Optional, K) -> () +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +// @objc K.init() +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances1KCACycfcTo : $@convention(objc_method) (@owned K) -> @owned K +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +// @objc K.test() +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances1KC4testSSSgyFTo : $@convention(objc_method) (K) -> @autoreleased Optional +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +@MainActor +class TestObjCMethod { + @objc func testImplicit() -> Int { 42 } + + @GlobalActor + @objc func testExplicit() {} +} + +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances14TestObjCMethodC12testImplicitSiyFTo : $@convention(objc_method) (TestObjCMethod) -> Int +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances14TestObjCMethodC12testExplicityyFTo : $@convention(objc_method) (TestObjCMethod) -> () +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +@objcMembers +class Super { + @MainActor func test() {} +} + +class Sub : Super { + override func test() {} +} + +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances5SuperC4testyyFTo : $@convention(objc_method) (Super) -> () +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () + +// CHECK-LABEL: sil private [thunk] [ossa] @$s27preconcurrency_conformances3SubC4testyyFTo : $@convention(objc_method) (Sub) -> () +// CHECK-NOT: [[PRECONDITION:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF : $@convention(thin) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, Builtin.Word, Builtin.Executor) -> () diff --git a/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift b/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift index 96b5043647f..4834d9ac236 100644 --- a/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift +++ b/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift @@ -12,7 +12,7 @@ // RUN: -I %t \ // RUN: -disable-availability-checking \ // RUN: -module-name Client \ -// RUN: -enable-experimental-feature DynamicActorIsolation \ +// RUN: -enable-upcoming-feature DynamicActorIsolation \ // RUN: %t/src/Client.swift -verify | %FileCheck %s // Delete swiftmodule to test building against swiftinterface @@ -23,7 +23,7 @@ // RUN: -I %t \ // RUN: -disable-availability-checking \ // RUN: -module-name Client \ -// RUN: -enable-experimental-feature DynamicActorIsolation \ +// RUN: -enable-upcoming-feature DynamicActorIsolation \ // RUN: %t/src/Client.swift -verify | %FileCheck %s // REQUIRES: asserts diff --git a/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis_objc.swift b/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis_objc.swift index 1601a520826..16c14a6e90d 100644 --- a/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis_objc.swift +++ b/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis_objc.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -target arm64-apple-macosx10.15 -enable-experimental-feature DynamicActorIsolation -emit-silgen -verify %s | %FileCheck %s +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -target arm64-apple-macosx10.15 -enable-upcoming-feature DynamicActorIsolation -emit-silgen -verify %s | %FileCheck %s // REQUIRES: objc_interop // REQUIRES: asserts diff --git a/test/Concurrency/preconcurrency_conformances.swift b/test/Concurrency/preconcurrency_conformances.swift index ce544948023..78d4b5e231e 100644 --- a/test/Concurrency/preconcurrency_conformances.swift +++ b/test/Concurrency/preconcurrency_conformances.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -swift-version 5 -disable-availability-checking %s -emit-sil -o /dev/null -verify -enable-experimental-feature DynamicActorIsolation -strict-concurrency=complete -verify-additional-prefix complete-tns- +// RUN: %target-swift-frontend -swift-version 5 -disable-availability-checking %s -emit-sil -o /dev/null -verify -enable-upcoming-feature DynamicActorIsolation -strict-concurrency=complete -verify-additional-prefix complete-tns- // REQUIRES: concurrency // REQUIRES: asserts diff --git a/test/Interpreter/preconcurrency_conformances.swift b/test/Interpreter/preconcurrency_conformances.swift index b8cd33c8ffb..efe7c2e18f0 100644 --- a/test/Interpreter/preconcurrency_conformances.swift +++ b/test/Interpreter/preconcurrency_conformances.swift @@ -12,21 +12,21 @@ // RUN: -target %target-cpu-apple-macosx10.15 \ // RUN: -I %t -L %t -l Interface \ // RUN: -emit-module-interface-path %t/Types.swiftinterface \ -// RUN: -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation +// RUN: -Xfrontend -enable-upcoming-feature -Xfrontend DynamicActorIsolation -// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash1.swift -o %t/crash1.out +// RUN: %target-build-swift -Xfrontend -enable-upcoming-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash1.swift -o %t/crash1.out // RUN: %target-codesign %t/crash1.out // RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash1.out 2>&1 | %FileCheck %t/src/Crash1.swift -// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash2.swift -o %t/crash2.out +// RUN: %target-build-swift -Xfrontend -enable-upcoming-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash2.swift -o %t/crash2.out // RUN: %target-codesign %t/crash2.out // RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash2.out 2>&1 | %FileCheck %t/src/Crash2.swift -// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash3.swift -o %t/crash3.out +// RUN: %target-build-swift -Xfrontend -enable-upcoming-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash3.swift -o %t/crash3.out // RUN: %target-codesign %t/crash3.out // RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash3.out 2>&1 | %FileCheck %t/src/Crash3.swift -// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash4.swift -o %t/crash4.out +// RUN: %target-build-swift -Xfrontend -enable-upcoming-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash4.swift -o %t/crash4.out // RUN: %target-codesign %t/crash4.out // RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash4.out 2>&1 | %FileCheck %t/src/Crash4.swift diff --git a/test/Interpreter/preconcurrency_conformances_with_disabled_checks.swift b/test/Interpreter/preconcurrency_conformances_with_disabled_checks.swift new file mode 100644 index 00000000000..911daa27a22 --- /dev/null +++ b/test/Interpreter/preconcurrency_conformances_with_disabled_checks.swift @@ -0,0 +1,105 @@ +// RUN: %empty-directory(%t/src) +// RUN: split-file %s %t/src + +// RUN: %target-build-swift %t/src/Interface.swift -emit-module -emit-library \ +// RUN: -target %target-cpu-apple-macosx10.15 -swift-version 5 \ +// RUN: -enable-library-evolution \ +// RUN: -module-name Interface \ +// RUN: -o %t/%target-library-name(Interface) \ +// RUN: -emit-module-interface-path %t/Interface.swiftinterface + +// RUN: %target-build-swift %t/src/Types.swift -swift-version 5 -emit-module -emit-library -enable-library-evolution -module-name Types -o %t/%target-library-name(Types) \ +// RUN: -target %target-cpu-apple-macosx10.15 \ +// RUN: -I %t -L %t -l Interface \ +// RUN: -emit-module-interface-path %t/Types.swiftinterface \ +// RUN: -Xfrontend -enable-upcoming-feature -Xfrontend DynamicActorIsolation \ +// RUN: -Xfrontend -disable-dynamic-actor-isolation + +// RUN: %target-build-swift -I %t -L %t -l Types %t/src/Test1.swift -o %t/test1.out +// RUN: %target-codesign %t/test1.out +// RUN: env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/test1.out 2>&1 | %FileCheck %t/src/Test1.swift + +// RUN: %target-build-swift -I %t -L %t -l Types %t/src/Test2.swift -o %t/test2.out +// RUN: %target-codesign %t/test2.out +// RUN: env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/test2.out 2>&1 | %FileCheck %t/src/Test2.swift + +// RUN: %target-build-swift -I %t -L %t -l Types %t/src/Test3.swift -o %t/test3.out +// RUN: %target-codesign %t/test3.out +// RUN: env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/test3.out 2>&1 | %FileCheck %t/src/Test3.swift + +// RUN: %target-build-swift -I %t -L %t -l Types %t/src/Test4.swift -o %t/test4.out +// RUN: %target-codesign %t/test4.out +// RUN: env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/test4.out 2>&1 | %FileCheck %t/src/Test4.swift + +// REQUIRES: asserts +// REQUIRES: concurrency +// REQUIRES: concurrency_runtime +// REQUIRES: executable_test +// REQUIRES: OS=macosx + +// rdar://123810657 +// UNSUPPORTED: back_deployment_runtime + +//--- Interface.swift +public protocol P { + init() + + var prop: [String] { get set } + func test() -> Int +} + +//--- Types.swift +import Interface + +public func runTest(_ type: T.Type) async -> Int { + let v = type.init() + return v.test() +} + +public func runAccessors(_ type: T.Type) async -> [String] { + var v = type.init() + v.prop = ["a", "b", "c"] + return v.prop +} + +public final class Test : @preconcurrency P { + @MainActor public var prop: [String] = [] + @MainActor public func test() -> Int { 42 } + + public init() {} +} + +public actor ActorTest { + var x: Int = 0 + + public init() {} +} + +extension ActorTest : @preconcurrency P { + public var prop: [String] { + get { [] } + set { } + } + + public func test() -> Int { x } +} + +//--- Test1.swift +import Types +print(await runTest(Test.self)) +// CHECK-NOT: Incorrect actor executor assumption; Expected MainActor executor + +//--- Test2.swift +import Types +print(await runAccessors(Test.self)) +// CHECK-NOT: Incorrect actor executor assumption; Expected MainActor executor + +//--- Test3.swift +import Types +print(await runTest(ActorTest.self)) +// CHECK-NOT: Incorrect actor executor assumption + +//--- Test4.swift +import Types +print(await runAccessors(ActorTest.self)) +// CHECK-NOT: Incorrect actor executor assumption diff --git a/test/ModuleInterface/preconcurrency_conformances.swift b/test/ModuleInterface/preconcurrency_conformances.swift index 459afd610b4..0b0900ae5af 100644 --- a/test/ModuleInterface/preconcurrency_conformances.swift +++ b/test/ModuleInterface/preconcurrency_conformances.swift @@ -12,17 +12,17 @@ // RUN: -module-name Client -I %t -swift-version 5 -enable-library-evolution \ // RUN: -emit-module-path %t/Client.swiftmodule \ // RUN: -emit-module-interface-path %t/Client.swiftinterface \ -// RUN: -enable-experimental-feature DynamicActorIsolation \ +// RUN: -enable-upcoming-feature DynamicActorIsolation \ // RUN: -disable-availability-checking \ // RUN: -verify // RUN: %FileCheck %s < %t/Client.swiftinterface // RUN: %target-swift-emit-module-interface(%t/Client.swiftinterface) -I %t %t/src/Client.swift -module-name Client \ -// RUN: -disable-availability-checking -enable-experimental-feature DynamicActorIsolation -verify +// RUN: -disable-availability-checking -enable-upcoming-feature DynamicActorIsolation -verify // RUN: %target-swift-typecheck-module-from-interface(%t/Client.swiftinterface) -I %t -module-name Client \ -// RUN: -disable-availability-checking -enable-experimental-feature DynamicActorIsolation -verify +// RUN: -disable-availability-checking -enable-upcoming-feature DynamicActorIsolation -verify // REQUIRES: asserts // REQUIRES: concurrency @@ -44,8 +44,8 @@ public protocol WithAssoc { //--- Client.swift import A -// CHECK: #if {{.*}} $DynamicActorIsolation -// CHECK-NEXT: @_Concurrency.MainActor public struct GlobalActorTest : @preconcurrency A.P +// CHECK-NOT: #if {{.*}} $DynamicActorIsolation +// CHECK: @_Concurrency.MainActor public struct GlobalActorTest : @preconcurrency A.P @MainActor public struct GlobalActorTest : @preconcurrency P { @@ -56,14 +56,14 @@ public struct GlobalActorTest : @preconcurrency P { public class ExtTest { } -// CHECK: #if {{.*}} $DynamicActorIsolation -// CHECK-NEXT: extension Client.ExtTest : @preconcurrency A.P +// CHECK-NOT: #if {{.*}} $DynamicActorIsolation +// CHECK: extension Client.ExtTest : @preconcurrency A.P extension ExtTest : @preconcurrency P { public func test() -> Int { 1 } } -// CHECK: #if {{.*}} && $DynamicActorIsolation -// CHECK-NEXT: public actor ActorTest : @preconcurrency A.P +// CHECK-NOT: #if {{.*}} && $DynamicActorIsolation +// CHECK: public actor ActorTest : @preconcurrency A.P public actor ActorTest : @preconcurrency P { public func test() -> Int { 2 } } @@ -71,22 +71,21 @@ public actor ActorTest : @preconcurrency P { public actor ActorExtTest { } -// CHECK: #if {{.*}} $DynamicActorIsolation -// CHECK-NEXT: extension Client.ActorExtTest : @preconcurrency A.Q +// CHECK-NOT: #if {{.*}} $DynamicActorIsolation +// CHECK: extension Client.ActorExtTest : @preconcurrency A.Q extension ActorExtTest : @preconcurrency Q { public var x: Int { 42 } } public struct TestConditional {} -// CHECK: #if {{.*}} $DynamicActorIsolation -// CHECK-NEXT: extension Client.TestConditional : @preconcurrency A.WithAssoc where T == Swift.Int { +// CHECK-NOT: #if {{.*}} $DynamicActorIsolation +// CHECK: extension Client.TestConditional : @preconcurrency A.WithAssoc where T == Swift.Int { // CHECK-NEXT: @_Concurrency.MainActor public func test() -> T // CHECK-NEXT: } extension TestConditional : @preconcurrency WithAssoc where T == Int { @MainActor public func test() -> T { 42 } // Ok } -// CHECK: #if {{.*}} $DynamicActorIsolation -// CHECK-NEXT: extension Client.GlobalActorTest : Swift.Sendable {} -// CHECK-NEXT: #endif +// CHECK-NOT: #if {{.*}} $DynamicActorIsolation +// CHECK: extension Client.GlobalActorTest : Swift.Sendable {} diff --git a/test/SILGen/preconcurrency_conformances.swift b/test/SILGen/preconcurrency_conformances.swift index a4afe72d209..e1c47378ca6 100644 --- a/test/SILGen/preconcurrency_conformances.swift +++ b/test/SILGen/preconcurrency_conformances.swift @@ -1,8 +1,13 @@ -// RUN: %target-swift-emit-silgen -disable-availability-checking -module-name preconcurrency_conformances -enable-experimental-feature DynamicActorIsolation %s -verify | %FileCheck %s +// RUN: %empty-directory(%t/src) +// RUN: split-file %s %t/src + +// RUN: %target-swift-emit-silgen -disable-availability-checking -module-name preconcurrency_conformances -enable-upcoming-feature DynamicActorIsolation %t/src/checks.swift -verify | %FileCheck %t/src/checks.swift +// RUN: %target-swift-emit-silgen -swift-version 6 -disable-availability-checking -module-name preconcurrency_conformances -disable-dynamic-actor-isolation %t/src/checks_disabled.swift -verify | %FileCheck %t/src/checks_disabled.swift // REQUIRES: asserts // REQUIRES: concurrency +//--- checks.swift protocol P { associatedtype T @@ -270,3 +275,167 @@ extension MyActor : @preconcurrency Q { // CHECK-NEXT: [[EXEC:%.*]] = extract_executor [[MAIN_ACTOR]] : $MainActor // CHECK: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF // CHECK-NEXT: {{.*}} = apply [[CHECK_EXEC_REF]]({{.*}}, [[EXEC]]) + +//--- checks_disabled.swift +protocol P { + associatedtype T + + var prop: T { get set } + func fn() -> T? +} + +protocol Q { + static var data: [Int]? { get set } + static func staticFn() -> String? +} + +actor MyActor { +} + +@globalActor +struct GlobalActor { + static let shared: MyActor = MyActor() +} + +@MainActor +struct IsolatedType : @preconcurrency P { + var prop: T + func fn() -> T? { nil } +} + +// protocol witness for P.prop.getter in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1PA2aEP4prop1TQzvgTW : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> (@in_guaranteed IsolatedType<τ_0_0>) -> @out τ_0_0 +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.prop.setter in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1PA2aEP4prop1TQzvsTW : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> (@in τ_0_0, @inout IsolatedType<τ_0_0>) -> () +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.prop.modify in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1PA2aEP4prop1TQzvMTW : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> @substituted <τ_0_0, τ_0_1> (@inout τ_0_0) -> @yields @inout τ_0_1 for , τ_0_0> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.fn() in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1PA2aEP2fn1TQzSgyFTW : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> (@in_guaranteed IsolatedType<τ_0_0>) -> @out Optional<τ_0_0> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +extension IsolatedType : @preconcurrency Q { + static var data: [Int]? { + get { nil } + set {} + } + + static func staticFn() -> String? { nil } +} + +// protocol witness for static Q.data.getter in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1QA2aEP4dataSaySiGSgvgZTW : $@convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> (@thick IsolatedType<τ_0_0>.Type) -> @owned Optional> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.data.setter in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1QA2aEP4dataSaySiGSgvsZTW : $@convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> (@owned Optional>, @thick IsolatedType<τ_0_0>.Type) -> () +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.data.modify in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1QA2aEP4dataSaySiGSgvMZTW : $@yield_once @convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> @substituted <τ_0_0> (@thick τ_0_0.Type) -> @yields @inout Optional> for > +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.staticFn() in conformance IsolatedType +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances12IsolatedTypeVyxGAA1QA2aEP8staticFnSSSgyFZTW : $@convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> (@thick IsolatedType<τ_0_0>.Type) -> @owned Optional +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +class IsolatedMembers : @preconcurrency P { + @MainActor var prop: T { + get { fatalError() } + set {} + } + + @GlobalActor func fn() -> T? { nil } +} + +// protocol witness for P.prop.getter in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1PA2aEP4prop1TQzvgTW : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> (@in_guaranteed IsolatedMembers<τ_0_0>) -> @out τ_0_0 +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.prop.setter in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1PA2aEP4prop1TQzvsTW : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> (@in τ_0_0, @inout IsolatedMembers<τ_0_0>) -> () +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.prop.modify in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1PA2aEP4prop1TQzvMTW : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> @substituted <τ_0_0, τ_0_1> (@inout τ_0_0) -> @yields @inout τ_0_1 for , τ_0_0> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.fn() in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1PA2aEP2fn1TQzSgyFTW : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : Sendable> (@in_guaranteed IsolatedMembers<τ_0_0>) -> @out Optional<τ_0_0> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +extension IsolatedMembers : @preconcurrency Q { + @GlobalActor static var data: [Int]? { + get { nil } + set {} + } + + @MainActor static func staticFn() -> String? { nil } +} + +// protocol witness for static Q.data.getter in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1QA2aEP4dataSaySiGSgvgZTW : $@convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> (@thick IsolatedMembers<τ_0_0>.Type) -> @owned Optional> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.data.setter in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1QA2aEP4dataSaySiGSgvsZTW : $@convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> (@owned Optional>, @thick IsolatedMembers<τ_0_0>.Type) -> () +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.data.modify in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1QA2aEP4dataSaySiGSgvMZTW : $@yield_once @convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> @substituted <τ_0_0> (@thick τ_0_0.Type) -> @yields @inout Optional> for > +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.staticFn() in conformance IsolatedMembers +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances15IsolatedMembersCyxGAA1QA2aEP8staticFnSSSgyFZTW : $@convention(witness_method: Q) <τ_0_0 where τ_0_0 : Sendable> (@thick IsolatedMembers<τ_0_0>.Type) -> @owned Optional +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +extension MyActor : @preconcurrency P { + var prop: Int { + get { 42 } + set {} + } + + func fn() -> Int? { nil } +} + +// protocol witness for P.prop.getter in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1PA2aDP4prop1TQzvgTW : $@convention(witness_method: P) (@in_guaranteed MyActor) -> @out Int +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.prop.setter in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1PA2aDP4prop1TQzvsTW : $@convention(witness_method: P) (@in Int, @inout MyActor) -> () +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.prop.modify in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1PA2aDP4prop1TQzvMTW : $@yield_once @convention(witness_method: P) @substituted <τ_0_0, τ_0_1> (@inout τ_0_0) -> @yields @inout τ_0_1 for +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for P.fn() in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1PA2aDP2fn1TQzSgyFTW : $@convention(witness_method: P) (@in_guaranteed MyActor) -> @out Optional +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +extension MyActor : @preconcurrency Q { + @MainActor static var data: [Int]? { + get { nil } + set {} + } + + @MainActor static func staticFn() -> String? { nil } +} + +// protocol witness for static Q.data.getter in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1QA2aDP4dataSaySiGSgvgZTW : $@convention(witness_method: Q) (@thick MyActor.Type) -> @owned Optional> +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.data.setter in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1QA2aDP4dataSaySiGSgvsZTW : $@convention(witness_method: Q) (@owned Optional>, @thick MyActor.Type) -> () +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF + +// protocol witness for static Q.data.modify in conformance MyActor +// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s27preconcurrency_conformances7MyActorCAA1QA2aDP4dataSaySiGSgvMZTW : $@yield_once @convention(witness_method: Q) @substituted <τ_0_0> (@thick τ_0_0.Type) -> @yields @inout Optional> for +// CHECK-NOT: [[CHECK_EXEC_REF:%.*]] = function_ref @$ss22_checkExpectedExecutor14_filenameStart01_D6Length01_D7IsASCII5_line9_executoryBp_BwBi1_BwBetF diff --git a/test/SILGen/preconcurrency_conformances_backdeploy.swift b/test/SILGen/preconcurrency_conformances_backdeploy.swift index 6462f12a70d..df8f021b279 100644 --- a/test/SILGen/preconcurrency_conformances_backdeploy.swift +++ b/test/SILGen/preconcurrency_conformances_backdeploy.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -primary-file %s -target %target-cpu-apple-macosx10.14 -enable-experimental-feature DynamicActorIsolation -emit-silgen -o - | %FileCheck %s +// RUN: %target-swift-frontend -primary-file %s -target %target-cpu-apple-macosx10.14 -enable-upcoming-feature DynamicActorIsolation -emit-silgen -o - | %FileCheck %s // REQUIRES: asserts // REQUIRES: concurrency