Diagnose typealiases of non-public types in inlinable functions (#23912)

...as a warning, since we didn't check this correctly in Swift 5.
For parseable interfaces, these typealiases won't work at all.
This commit is contained in:
Jordan Rose
2019-04-10 09:21:44 -07:00
committed by GitHub
parent 8e5dbcfde2
commit a15dec8774
3 changed files with 15 additions and 2 deletions

View File

@@ -309,7 +309,8 @@ bool DeclContext::isGenericContext() const {
/// domains, this ensures that only sufficiently-conservative access patterns
/// are used.
ResilienceExpansion DeclContext::getResilienceExpansion() const {
for (const auto *dc = this; dc->isLocalContext(); dc = dc->getParent()) {
for (const auto *dc = getLocalContext(); dc && dc->isLocalContext();
dc = dc->getParent()) {
// Default argument initializer contexts have their resilience expansion
// set when they're type checked.
if (isa<DefaultArgumentInitializer>(dc)) {