File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1611,23 +1611,25 @@ void GenericSignature::verify(ArrayRef<Requirement> reqts) const {
1611
1611
break ;
1612
1612
1613
1613
case RequirementKind::SameType: {
1614
- auto isCanonicalAnchor = [&](Type type) {
1615
- if (auto *dmt = type->getAs <DependentMemberType>())
1616
- return canSig->isCanonicalTypeInContext (dmt->getBase ());
1614
+ auto hasCanonicalOrConcreteParent = [&](Type type) {
1615
+ if (auto *dmt = type->getAs <DependentMemberType>()) {
1616
+ return (canSig->isCanonicalTypeInContext (dmt->getBase ()) ||
1617
+ canSig->isConcreteType (dmt->getBase ()));
1618
+ }
1617
1619
return type->is <GenericTypeParamType>();
1618
1620
};
1619
1621
1620
1622
auto firstType = reqt.getFirstType ();
1621
1623
auto secondType = reqt.getSecondType ();
1622
- if (!isCanonicalAnchor (firstType)) {
1624
+ if (!hasCanonicalOrConcreteParent (firstType)) {
1623
1625
llvm::errs () << " Left hand side does not have a canonical parent: " ;
1624
1626
reqt.dump (llvm::errs ());
1625
1627
llvm::errs () << " \n " ;
1626
1628
abort ();
1627
1629
}
1628
1630
1629
1631
if (reqt.getSecondType ()->isTypeParameter ()) {
1630
- if (!isCanonicalAnchor (secondType)) {
1632
+ if (!hasCanonicalOrConcreteParent (secondType)) {
1631
1633
llvm::errs () << " Right hand side does not have a canonical parent: " ;
1632
1634
reqt.dump (llvm::errs ());
1633
1635
llvm::errs () << " \n " ;
You can’t perform that action at this time.
0 commit comments