Skip to content

Commit 696c8f1

Browse files
committed
[ConstraintSystem] Implement simplication of PatternMatch element
1 parent ea355fd commit 696c8f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4758,6 +4758,12 @@ void constraints::simplifyLocator(ASTNode &anchor,
47584758
path = path.slice(1);
47594759
continue;
47604760
}
4761+
4762+
if (anchor.is<Pattern *>()) {
4763+
path = path.slice(1);
4764+
continue;
4765+
}
4766+
47614767
break;
47624768

47634769
case ConstraintLocator::SubscriptMember:
@@ -4851,6 +4857,13 @@ void constraints::simplifyLocator(ASTNode &anchor,
48514857
continue;
48524858
}
48534859

4860+
case ConstraintLocator::PatternMatch: {
4861+
auto patternElt = path[0].castTo<LocatorPathElt::PatternMatch>();
4862+
anchor = patternElt.getPattern();
4863+
path = path.slice(1);
4864+
continue;
4865+
}
4866+
48544867
default:
48554868
// FIXME: Lots of other cases to handle.
48564869
break;

0 commit comments

Comments
 (0)