[ConstraintLocator] Add information about expected value type to key path locator

Record a "value" type associated with this location to be able to
reference during inference.
This commit is contained in:
Pavel Yaskevich
2021-05-27 14:33:06 -07:00
parent 1a07733b33
commit b7a7024e0a
4 changed files with 22 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ bool ConstraintLocator::isKeyPathType() const {
// The format of locator should be `<keypath expr> -> key path type`
if (!anchor || !isExpr<KeyPathExpr>(anchor) || path.size() != 1)
return false;
return path.back().getKind() == ConstraintLocator::KeyPathType;
return path.back().is<LocatorPathElt::KeyPathType>();
}
bool ConstraintLocator::isKeyPathRoot() const {