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);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (anchor.is<Pattern *>()) {
|
||||
path = path.slice(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ConstraintLocator::SubscriptMember:
|
||||
@@ -4851,6 +4857,13 @@ void constraints::simplifyLocator(ASTNode &anchor,
|
||||
continue;
|
||||
}
|
||||
|
||||
case ConstraintLocator::PatternMatch: {
|
||||
auto patternElt = path[0].castTo<LocatorPathElt::PatternMatch>();
|
||||
anchor = patternElt.getPattern();
|
||||
path = path.slice(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
default:
|
||||
// FIXME: Lots of other cases to handle.
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user