Skip to content

Commit 8a8e71e

Browse files
committed
Ignore Sendable conformances in PrintAsClang
PrintAsClang previously tried to print Sendable conformances, which tripped an assertion and failed. Skip them instead. Fixes rdar://95241184.
1 parent 0c67ce6 commit 8a8e71e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/PrintAsClang/ModuleContentsWriter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,10 @@ class ModuleWriter {
433433
bool allRequirementsSatisfied = true;
434434

435435
for (auto proto : PD->getInheritedProtocols()) {
436-
assert(proto->isObjC());
437-
allRequirementsSatisfied &= require(proto);
436+
if (printer.shouldInclude(proto)) {
437+
assert(proto->isObjC());
438+
allRequirementsSatisfied &= require(proto);
439+
}
438440
}
439441

440442
if (!allRequirementsSatisfied)

test/PrintAsObjC/protocols.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import objc_generics
2525

2626
// CHECK-LABEL: @protocol B <A>
2727
// CHECK-NEXT: @end
28-
@objc protocol B : A {}
28+
@objc protocol B : A, Sendable {}
2929

3030
// CHECK-LABEL: @protocol CompletionAndAsync
3131
// CHECK-NEXT: - (void)helloWithCompletion:(void (^ _Nonnull)(BOOL))completion;

0 commit comments

Comments
 (0)