From 27e5c212de05f10177b9ca4375638a2e46929543 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 3 Apr 2016 15:46:39 +0200 Subject: Fix comment --- src/dotty/tools/dotc/core/Denotations.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools') 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 } -- cgit v1.2.3