Skip to content

Commit f34d563

Browse files
committed
Dotty deviation in shadowing rules for names.
ping @samuelgruetter Martin told that this is intended, I'm not sure if rewriting tool can do something here.
1 parent 6689cce commit f34d563

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import dotty.tools.dotc.ast.{untpd, tpd}
1414
import dotty.tools.dotc.core.Constants.Constant
1515
import dotty.tools.dotc.core.Types.{ExprType, NoType, MethodType}
1616
import dotty.tools.dotc.core.Names.Name
17-
import dotty.runtime.LazyVals
17+
import dotty.runtime.{LazyVals => RLazyVals} // dotty deviation
1818
import SymUtils._
1919
import scala.collection.mutable.ListBuffer
2020
import dotty.tools.dotc.core.Denotations.SingleDenotation
@@ -288,15 +288,15 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
288288
val thiz = This(claz)(ctx.fresh.setOwner(claz))
289289
val companion = claz.companionModule
290290
val helperModule = ctx.requiredModule("dotty.runtime.LazyVals")
291-
val getOffset = Select(ref(helperModule), LazyVals.Names.getOffset.toTermName)
291+
val getOffset = Select(ref(helperModule), RLazyVals.Names.getOffset.toTermName)
292292
var offsetSymbol: TermSymbol = null
293293
var flag: Tree = EmptyTree
294294
var ord = 0
295295

296296
// compute or create appropriate offsetSymol, bitmap and bits used by current ValDef
297297
appendOffsetDefs.get(companion.name.moduleClassName) match {
298298
case Some(info) =>
299-
val flagsPerLong = 64 / LazyVals.BITS_PER_LAZY_VAL
299+
val flagsPerLong = 64 / RLazyVals.BITS_PER_LAZY_VAL
300300
info.ord += 1
301301
ord = info.ord % flagsPerLong
302302
val id = info.ord / flagsPerLong
@@ -327,11 +327,11 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
327327
val containerTree = ValDef(containerSymbol, initValue(tpe))
328328

329329
val offset = Select(ref(companion), offsetSymbol.name)
330-
val getFlag = Select(ref(helperModule), LazyVals.Names.get.toTermName)
331-
val setFlag = Select(ref(helperModule), LazyVals.Names.setFlag.toTermName)
332-
val wait = Select(ref(helperModule), LazyVals.Names.wait4Notification.toTermName)
333-
val state = Select(ref(helperModule), LazyVals.Names.state.toTermName)
334-
val cas = Select(ref(helperModule), LazyVals.Names.cas.toTermName)
330+
val getFlag = Select(ref(helperModule), RLazyVals.Names.get.toTermName)
331+
val setFlag = Select(ref(helperModule), RLazyVals.Names.setFlag.toTermName)
332+
val wait = Select(ref(helperModule), RLazyVals.Names.wait4Notification.toTermName)
333+
val state = Select(ref(helperModule), RLazyVals.Names.state.toTermName)
334+
val cas = Select(ref(helperModule), RLazyVals.Names.cas.toTermName)
335335

336336
val accessor = mkThreadSafeDef(x.symbol.asTerm, claz, ord, containerSymbol, rhs, tpe, offset, getFlag, state, cas, setFlag, wait)
337337
if(flag eq EmptyTree)

0 commit comments

Comments
 (0)