Skip to content

Commit 11aecda

Browse files
committed
RequirementMachine: Only add a concrete type adjustment step if the symbol has substitutions
1 parent 6441b8b commit 11aecda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/AST/RequirementMachine/RewriteSystemCompletion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,9 @@ RewriteSystem::computeCriticalPair(ArrayRef<Symbol>::const_iterator from,
450450
// perform the concrete type adjustment:
451451
//
452452
// (σ - T)
453-
if (xv.back().isSuperclassOrConcreteType() && t.size() > 0) {
453+
if (xv.back().isSuperclassOrConcreteType() &&
454+
!xv.back().getSubstitutions().empty() &&
455+
t.size() > 0) {
454456
path.add(RewriteStep::forAdjustment(t.size(), /*inverse=*/true));
455457

456458
xv.back() = xv.back().prependPrefixToConcreteSubstitutions(

0 commit comments

Comments
 (0)