Skip to content

Commit 11f9ea7

Browse files
Merge pull request #77572 from nate-chandler/rdar139759304
[BitwiseCopyable] Permit conformance in overlay.
2 parents 4934b79 + 80390ce commit 11f9ea7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Sema/TypeCheckBitwise.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,10 @@ bool swift::checkBitwiseCopyableConformance(ProtocolConformance *conformance,
417417
return false;
418418
}
419419

420-
// BitwiseCopyable must be added in the same source file.
420+
// BitwiseCopyable must be added in the same module or its overlay.
421421
auto conformanceDecl = conformanceDC->getAsDecl();
422-
if (conformanceDecl->getModuleContext() != nominal->getModuleContext()) {
422+
if (!conformanceDecl->getModuleContext()->isSameModuleLookingThroughOverlays(
423+
nominal->getModuleContext())) {
423424
conformanceDecl->diagnose(diag::bitwise_copyable_outside_module, nominal);
424425
return true;
425426
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
@_exported import ClangModuleWithOverlay
22

3+
extension ClangType : BitwiseCopyable {}
4+
35
public func fromSwiftOverlay() {}

0 commit comments

Comments
 (0)