@retroactive conformance syntax and checking (#36068)

This commit is contained in:
Harlan Haskins
2023-10-20 14:27:03 -07:00
committed by GitHub
parent f1bec99705
commit 4ac34a40ea
46 changed files with 493 additions and 65 deletions

View File

@@ -2927,6 +2927,23 @@ ModuleDecl::getDeclaringModuleAndBystander() {
return *(declaringModuleAndBystander = {nullptr, Identifier()});
}
bool ModuleDecl::isClangOverlayOf(ModuleDecl *potentialUnderlying) {
return getUnderlyingModuleIfOverlay() == potentialUnderlying;
}
bool ModuleDecl::isSameModuleLookingThroughOverlays(
ModuleDecl *other) {
if (this == other) {
return true;
}
if (this->isClangOverlayOf(other) || other->isClangOverlayOf(this)) {
return true;
}
return false;
}
bool ModuleDecl::isCrossImportOverlayOf(ModuleDecl *other) {
ModuleDecl *current = this;
ModuleDecl *otherClang = other->getUnderlyingModuleIfOverlay();