File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3533,6 +3533,14 @@ bool NominalTypeDecl::isResilient() const {
3533
3533
return getModuleContext ()->isResilient ();
3534
3534
}
3535
3535
3536
+ static bool isOriginallyDefinedIn (const Decl *D, const ModuleDecl* MD) {
3537
+ if (!MD)
3538
+ return false ;
3539
+ if (D->getAlternateModuleName ().empty ())
3540
+ return false ;
3541
+ return D->getAlternateModuleName () == MD->getName ().str ();
3542
+ }
3543
+
3536
3544
bool NominalTypeDecl::isResilient (ModuleDecl *M,
3537
3545
ResilienceExpansion expansion) const {
3538
3546
switch (expansion) {
@@ -3542,8 +3550,8 @@ bool NominalTypeDecl::isResilient(ModuleDecl *M,
3542
3550
// We consider this decl belongs to the module either it's currently
3543
3551
// defined in this module or it's originally defined in this module, which
3544
3552
// is specified by @_originallyDefinedIn
3545
- return M != getModuleContext () &&
3546
- M-> getName (). str () != getAlternateModuleName () && isResilient ();
3553
+ return M != getModuleContext () && ! isOriginallyDefinedIn ( this , M) &&
3554
+ isResilient ();
3547
3555
}
3548
3556
llvm_unreachable (" bad resilience expansion" );
3549
3557
}
You can’t perform that action at this time.
0 commit comments