mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Hacky fix for infinite recursion if a class inherits from itself
This seems to come up a lot; we need to consolidate and clean up inheritance circularity breaks.
This commit is contained in:
@@ -75,6 +75,10 @@ bool IterativeTypeChecker::isQualifiedLookupInDeclContextSatisfied(
|
||||
|
||||
if (auto superclass = classDecl->getSuperclass()) {
|
||||
if (auto superclassDecl = superclass->getAnyNominal()) {
|
||||
// Hack.
|
||||
if (superclassDecl == nominal)
|
||||
return true;
|
||||
|
||||
if (!isSatisfied(requestQualifiedLookupInDeclContext({ superclassDecl,
|
||||
payload.Name,
|
||||
payload.Loc })))
|
||||
|
||||
Reference in New Issue
Block a user