aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-04-03 15:46:39 +0200
committerMartin Odersky <odersky@gmail.com>2016-04-03 15:46:39 +0200
commit27e5c212de05f10177b9ca4375638a2e46929543 (patch)
treecd1a4d7be5ad8ea656f1a03fa8a7c90f82d1e15d /src/dotty/tools/dotc/core/Denotations.scala
parentf5c220082048f9a7d67548a5619395f97139f088 (diff)
downloaddotty-27e5c212de05f10177b9ca4375638a2e46929543.tar.gz
dotty-27e5c212de05f10177b9ca4375638a2e46929543.tar.bz2
dotty-27e5c212de05f10177b9ca4375638a2e46929543.zip
Fix comment
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index 542e89700..6e7eed3bc 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -747,9 +747,9 @@ object Denotations {
/** Insert this denotation instead of `old`.
* Also ensure that `old` refers with `nextInRun` to this denotation
- * inserted denotation and set its `validFor` field to `NoWhere`. This
- * is important do that references to the old denotation can find via
- * current a valid denotation.
+ * and set its `validFor` field to `NoWhere`. This is necessary so that
+ * references to the old denotation can be brought forward via `current`
+ * to a valid denotation.
*
* The code to achieve this is subtle in that it works correctly
* whether the replaced denotation is the only one in its cycle or not.
@@ -757,8 +757,9 @@ object Denotations {
private def insertInsteadOf(old: SingleDenotation): Unit = {
var prev = old
while (prev.nextInRun ne old) prev = prev.nextInRun
+ // order of next two assignments is important!
prev.nextInRun = this
- this.nextInRun = old.nextInRun // order of previous two assignments is important!
+ this.nextInRun = old.nextInRun
old.validFor = Nowhere
}