File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,8 @@ enum class OverlapKind {
219219// / The first atom in the term must be a protocol, generic parameter, or
220220// / associated type atom.
221221// /
222- // / A layout constraint atom must only appear at the end of a term.
222+ // / A layout, superclass or concrete type atom must only appear at the
223+ // / end of a term.
223224// /
224225// / Out-of-line methods are documented in RewriteSystem.cpp.
225226class Term final {
Original file line number Diff line number Diff line change @@ -1357,6 +1357,17 @@ void RewriteSystem::processMergedAssociatedTypes() {
13571357// / There is also an additional wrinkle. If we're in case 2, and the
13581358// / last atom of V is a superclass or concrete type atom A, we prepend
13591359// / T to each substitution of A.
1360+ // /
1361+ // / For example, suppose we have the following two rules:
1362+ // /
1363+ // / A.B -> C
1364+ // / B.[concrete: Foo<X>] -> B
1365+ // /
1366+ // / The overlapped term is A.B.[concrete: Foo<X>], so the critical pair
1367+ // / is (C.[concrete: Foo<A.X>], A.B). We prepended 'A' to the
1368+ // / concrete substitution 'X' to get 'A.X'; the new concrete term
1369+ // / is now rooted at the same level as A.B in the rewrite system,
1370+ // / not just B.
13601371Optional<std::pair<MutableTerm, MutableTerm>>
13611372RewriteSystem::computeCriticalPair (const Rule &lhs, const Rule &rhs) const {
13621373 MutableTerm t, v;
You can’t perform that action at this time.
0 commit comments