[Observation] Create nonisolated conformances to Observable

This is needed to make default-main-actor mode work well with
Observable. Fixes rdar://150419628.
This commit is contained in:
Doug Gregor
2025-05-01 21:59:20 -07:00
parent 3a01fc18b4
commit fed18d58dc
2 changed files with 3 additions and 3 deletions

View File

@@ -381,7 +381,7 @@ extension ObservableMacro: ExtensionMacro {
}
let decl: DeclSyntax = """
extension \(raw: type.trimmedDescription): \(raw: qualifiedConformanceName) {}
extension \(raw: type.trimmedDescription): nonisolated \(raw: qualifiedConformanceName) {}
"""
let ext = decl.cast(ExtensionDeclSyntax.self)

View File

@@ -2152,8 +2152,8 @@ std::optional<unsigned> swift::expandExtensions(CustomAttr *attr,
for (auto i : inheritedTypes.getIndices()) {
auto constraint =
TypeResolution::forInterface(
extension->getDeclContext(),
TypeResolverContext::GenericRequirement,
extension,
TypeResolverContext::Inherited,
/*unboundTyOpener*/ nullptr,
/*placeholderHandler*/ nullptr,
/*packElementOpener*/ nullptr)