mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[BitwiseCopyable] Permit conformance in overlay.
rdar://139759304
This commit is contained in:
@@ -417,9 +417,10 @@ bool swift::checkBitwiseCopyableConformance(ProtocolConformance *conformance,
|
||||
return false;
|
||||
}
|
||||
|
||||
// BitwiseCopyable must be added in the same source file.
|
||||
// BitwiseCopyable must be added in the same module or its overlay.
|
||||
auto conformanceDecl = conformanceDC->getAsDecl();
|
||||
if (conformanceDecl->getModuleContext() != nominal->getModuleContext()) {
|
||||
if (!conformanceDecl->getModuleContext()->isSameModuleLookingThroughOverlays(
|
||||
nominal->getModuleContext())) {
|
||||
conformanceDecl->diagnose(diag::bitwise_copyable_outside_module, nominal);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@_exported import ClangModuleWithOverlay
|
||||
|
||||
extension ClangType : BitwiseCopyable {}
|
||||
|
||||
public func fromSwiftOverlay() {}
|
||||
|
||||
Reference in New Issue
Block a user