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 {
219
219
// / The first atom in the term must be a protocol, generic parameter, or
220
220
// / associated type atom.
221
221
// /
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.
223
224
// /
224
225
// / Out-of-line methods are documented in RewriteSystem.cpp.
225
226
class Term final {
Original file line number Diff line number Diff line change @@ -1357,6 +1357,17 @@ void RewriteSystem::processMergedAssociatedTypes() {
1357
1357
// / There is also an additional wrinkle. If we're in case 2, and the
1358
1358
// / last atom of V is a superclass or concrete type atom A, we prepend
1359
1359
// / 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.
1360
1371
Optional<std::pair<MutableTerm, MutableTerm>>
1361
1372
RewriteSystem::computeCriticalPair (const Rule &lhs, const Rule &rhs) const {
1362
1373
MutableTerm t, v;
You can’t perform that action at this time.
0 commit comments