Skip to content

Commit 32670ee

Browse files
committed
fix
1 parent 8a4f965 commit 32670ee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/AST/GenericSignature.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,13 @@ Type GenericSignatureImpl::getUpperBound(Type type,
644644
// If the class contains a type parameter that cannot be reduced,
645645
// try looking for a non-dependent superclass.
646646
if (Type superclass = getSuperclassBound(type)) {
647-
do {
647+
while (superclass->hasTypeParameter()) {
648648
superclass = getReducedType(superclass);
649-
if (wantDependentBound || !superclass->hasTypeParameter()) {
649+
if (wantDependentBound && !superclass->hasTypeParameter()) {
650650
break;
651651
}
652-
} while ((superclass = superclass->getSuperclass()));
652+
superclass = superclass->getSuperclass();
653+
}
653654

654655
if (superclass) {
655656
types.push_back(superclass);

0 commit comments

Comments
 (0)