RequirementMachine: Rename RewriteStep::AdjustConcreteType to ::PrefixSubstitutions

This commit is contained in:
Slava Pestov
2022-02-03 15:01:26 -05:00
parent 7464a5f139
commit d8aa79c5e5
7 changed files with 47 additions and 42 deletions

View File

@@ -452,15 +452,15 @@ RewriteSystem::computeCriticalPair(ArrayRef<Symbol>::const_iterator from,
getRuleID(lhs),
/*inverse=*/true));
// (2) Next, if the right hand side rule ends with a concrete type symbol,
// perform the concrete type adjustment:
// (2) Next, if the right hand side rule ends with a superclass or concrete
// type symbol, remove the prefix 'T' from each substitution in the symbol.
//
// (σ - T)
if (xv.back().hasSubstitutions() &&
!xv.back().getSubstitutions().empty() &&
t.size() > 0) {
path.add(RewriteStep::forAdjustment(t.size(), /*endOffset=*/0,
/*inverse=*/true));
path.add(RewriteStep::forPrefixSubstitutions(t.size(), /*endOffset=*/0,
/*inverse=*/true));
xv.back() = xv.back().prependPrefixToConcreteSubstitutions(
t, Context);