mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #71470 from nate-chandler/bitwise-copyable/same-file
[BitwiseCopyable] Require conformance in same module as declaration.
This commit is contained in:
@@ -391,6 +391,13 @@ bool swift::checkBitwiseCopyableConformance(ProtocolConformance *conformance,
|
||||
return false;
|
||||
}
|
||||
|
||||
// BitwiseCopyable must be added in the same source file.
|
||||
auto conformanceDecl = conformanceDC->getAsDecl();
|
||||
if (conformanceDecl->getModuleContext() != nominal->getModuleContext()) {
|
||||
conformanceDecl->diagnose(diag::bitwise_copyable_outside_module, nominal);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto check = isImplicit ? BitwiseCopyableCheck::Implicit
|
||||
: BitwiseCopyableCheck::Explicit;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user