mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Implement simplication of PatternMatch element
This commit is contained in:
@@ -4758,6 +4758,12 @@ void constraints::simplifyLocator(ASTNode &anchor,
|
|||||||
path = path.slice(1);
|
path = path.slice(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (anchor.is<Pattern *>()) {
|
||||||
|
path = path.slice(1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ConstraintLocator::SubscriptMember:
|
case ConstraintLocator::SubscriptMember:
|
||||||
@@ -4851,6 +4857,13 @@ void constraints::simplifyLocator(ASTNode &anchor,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ConstraintLocator::PatternMatch: {
|
||||||
|
auto patternElt = path[0].castTo<LocatorPathElt::PatternMatch>();
|
||||||
|
anchor = patternElt.getPattern();
|
||||||
|
path = path.slice(1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// FIXME: Lots of other cases to handle.
|
// FIXME: Lots of other cases to handle.
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user