Skip to content

Commit 53ab11f

Browse files
committed
Fix
1 parent 0479db8 commit 53ab11f

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5534,10 +5534,6 @@ Type typeEraseOpenedExistentialReference(Type type, Type existentialBaseType,
55345534
TypeVariableType *openedTypeVar,
55355535
TypePosition outermostPosition);
55365536

5537-
Type transformFn(Type type, Type existentialBaseType,
5538-
TypePosition initialPos);
5539-
5540-
55415537
/// Returns true if a reference to a member on a given base type will apply
55425538
/// its curried self parameter, assuming it has one.
55435539
///

lib/AST/GenericSignature.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,13 @@ Type GenericSignatureImpl::getNonDependentUpperBounds(Type type) const {
638638
// If the class contains a type parameter that cannot be reduced,
639639
// try looking for a non-dependent superclass.
640640
if (Type superclass = getSuperclassBound(type)) {
641-
642641
if (auto *boundgeneric = dyn_cast<BoundGenericClassType>(superclass)) {
643642

644643
SmallVector<Type, 2> argTypes;
645644

646645
while (superclass && superclass->hasTypeParameter()) {
647646

648-
// check if the current class has associated types
647+
// check if the current class has generic arguments
649648
for (Type argTy : boundgeneric->getGenericArgs()) {
650649
argTypes.push_back(getReducedType(argTy));
651650
}
@@ -655,10 +654,10 @@ Type GenericSignatureImpl::getNonDependentUpperBounds(Type type) const {
655654
if (!boundgeneric->hasDependentMember() &&
656655
!boundgeneric->hasTypeParameter()) {
657656
superclass = boundgeneric;
658-
/*RequiresCoercion = true;*/
659657
break;
660658
}
661659
superclass = superclass->getSuperclass();
660+
// TO-DO: We should mark as 'requires coercion' if we have to erase to a non-dependent super type
662661
}
663662
}
664663

@@ -732,7 +731,6 @@ Type GenericSignatureImpl::getNonDependentUpperBounds(Type type) const {
732731
continue;
733732
}
734733
}
735-
// types.push_back(baseType);
736734
types.push_back(proto->getDeclaredInterfaceType());
737735
}
738736

lib/Sema/CSFix.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,6 @@ bool AddExplicitExistentialCoercion::isRequired(
24962496
if (!existentialType)
24972497
return Action::SkipChildren;
24982498

2499-
// let's grab the dependent upper bound here instead of nondependent
25002499
auto erasedMemberTy = typeEraseOpenedExistentialReference(
25012500
Type(member), *existentialType, typeVar, TypePosition::Covariant);
25022501

@@ -2562,7 +2561,6 @@ bool AddExplicitExistentialCoercion::isRequired(
25622561
case RequirementKind::Layout: {
25632562
if (isAnchoredOn(req.getFirstType(), member->getAssocType()))
25642563
return true;
2565-
25662564
break;
25672565
}
25682566

0 commit comments

Comments
 (0)