[CS] Use subclasses to expose locator element info

Instead of adding specific accessors directly to
ConstraintLocator::PathElement, add subclasses that expose these
accessors.
This commit is contained in:
Hamish Knight
2019-08-10 18:10:23 +01:00
parent 258d05aab8
commit a0919f73b0
12 changed files with 484 additions and 368 deletions

View File

@@ -1229,7 +1229,7 @@ ConstraintSystem::solveImpl(Expr *&expr,
bool isForSingleExprFunction =
getContextualTypePurpose() == CTP_ReturnSingleExpr;
auto *convertTypeLocator = getConstraintLocator(
expr, LocatorPathElt::getContextualType(isForSingleExprFunction));
expr, LocatorPathElt::ContextualType(isForSingleExprFunction));
if (allowFreeTypeVariables == FreeTypeVariableBinding::UnresolvedType) {
convertType = convertType.transform([&](Type type) -> Type {