Conversation
doc/1.4/language.md
Outdated
| } | ||
| ``` | ||
|
|
||
| [Template-qualified method implementation calls](#template-qualified-method-implementation-calls) is one way of resolving overrides that are ambiguous because they have the same rank. |
There was a problem hiding this comment.
Nit: conflicts don't typically arise due to two definitions of the same rank, but rather, because of two definitions of unrelated ranks (neither rank is higher than the other.) This is because ranks form a partial order rather than a total order. I'll clean this up with my commits.
Tangent: I don't think it's possible to provoke EAMBINH from definitions of the same rank at all. DMLC makes some checks that assumes that if two definitions are of the same rank, then they are being made in the same block; which it catches and reports as name collisions instead (ENAMECOLL). This is evidenced by this rather funny case that we unit-test:
template structural_clash {
// EAMBINH might be a better description of this clash
/// ERROR ENAMECOLL
param p default 1;
group g {
/// ERROR ENAMECOLL
param p default 2;
}
}
group gg is (structural_clash) {
group g is (structural_clash);
}
Here the param p definitions which the template places in two structurally distinct blocks are made to conflict, and stupid-dumb DMLC still reports it as a name collision rather than definitional ambiguity because both param definitions have the same rank.
|
@aeliasso I've touched up some stuff, and added some new stuff of my own. Take a look; I wanna make sure I haven't changed anything in a way you disagree with, and also check if I've written anything weird or confusing I need to explain better. |
| calls](#template-qualified-method-implementation-calls). | ||
|
|
||
| The technical rules for resolution of overrides, collectively called the | ||
| *ranking algorithm*, are as follows: |
There was a problem hiding this comment.
I couldn't resist. I figured I may as well officially coin the term since us DMLC developers use it all the time.
| See [Resolution of Overrides](language.html#resolution-of-overrides) | ||
| """ | ||
| # 'Resolution of overrides' does not exist in the 1.2 reference manual | ||
| version = "1.4" |
There was a problem hiding this comment.
@mandolaerik This makes me frown, but I suppose we could be OK with it. We don't care overmuch about the 1.2 reference manual rotting, do we?
To better fit with the changes of the previous commit
94d8f02 to
38fefb1
Compare
|
PR Verification: ✅ success |
No description provided.