[ConstraintSystem] Remove RValueAdjustment locator element

It was used for unresolved member and `.dynamicType` references
as well as a couple of other places, but now unresolved member
references no longer need that due to new implicit "chain result"
AST node and other places could use more precise locators
e.g. new `.dynamicType` locator or `sequence element` for `for in`
loops.
This commit is contained in:
Pavel Yaskevich
2020-10-26 00:40:39 -07:00
parent 860e14ecdf
commit 1683fb91b6
7 changed files with 20 additions and 27 deletions

View File

@@ -810,10 +810,10 @@ protected:
VarDecl *arrayVar = buildVar(loc);
Type arrayElementType = cs->createTypeVariable(
cs->getConstraintLocator(forEachStmt), 0);
cs->addConstraint(
ConstraintKind::Equal, cs->getType(bodyVar), arrayElementType,
cs->getConstraintLocator(
forEachStmt, ConstraintLocator::RValueAdjustment));
cs->addConstraint(ConstraintKind::Equal, cs->getType(bodyVar),
arrayElementType,
cs->getConstraintLocator(
forEachStmt, ConstraintLocator::SequenceElementType));
Type arrayType = ArraySliceType::get(arrayElementType);
cs->setType(arrayVar, arrayType);