diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index d6bf0fdc4a0d2..5ab923532748b 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -8343,6 +8343,7 @@ RawConformanceIsolationRequest::evaluate( if (proto->inheritsFrom(sendableMetatype)) { bool isPreconcurrency = moduleImportForPreconcurrency( proto, conformance->getDeclContext()) != nullptr; + isPreconcurrency |= proto->preconcurrency(); ctx.Diags.diagnose( conformance->getLoc(), diag::isolated_conformance_to_sendable_metatype, diff --git a/test/Concurrency/sendable_objc_attr_in_type_context_swift5.swift b/test/Concurrency/sendable_objc_attr_in_type_context_swift5.swift index 7e9d6c7c0f6ec..d4b1d55ba7305 100644 --- a/test/Concurrency/sendable_objc_attr_in_type_context_swift5.swift +++ b/test/Concurrency/sendable_objc_attr_in_type_context_swift5.swift @@ -211,3 +211,7 @@ extension TestDR { @_dynamicReplacement(for: test(completion:)) func __replaceObjCFunc(_: @escaping () -> Void) {} // Ok } + +@MainActor +class InvalidIsolated: NSObject, @MainActor P {} +// expected-warning@-1 {{cannot form main actor-isolated conformance of 'InvalidIsolated' to SendableMetatype-inheriting protocol 'P'}}