aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/LazyVals.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-02-03 13:46:48 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-02-03 14:59:03 +0100
commitf34d5630645c8ef608915f10e4ecee23ab3126b4 (patch)
tree56d94326af4aaa9537631d47b27dd447787be0bb /src/dotty/tools/dotc/transform/LazyVals.scala
parent6689cce56c15027f594dcc782f7823956dc996b7 (diff)
downloaddotty-f34d5630645c8ef608915f10e4ecee23ab3126b4.tar.gz
dotty-f34d5630645c8ef608915f10e4ecee23ab3126b4.tar.bz2
dotty-f34d5630645c8ef608915f10e4ecee23ab3126b4.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/transform/LazyVals.scala')
-rw-r--r--src/dotty/tools/dotc/transform/LazyVals.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/transform/LazyVals.scala b/src/dotty/tools/dotc/transform/LazyVals.scala
index 20e268581..e6f15d958 100644
--- a/src/dotty/tools/dotc/transform/LazyVals.scala
+++ b/src/dotty/tools/dotc/transform/LazyVals.scala
@@ -14,7 +14,7 @@ import dotty.tools.dotc.ast.{untpd, tpd}
import dotty.tools.dotc.core.Constants.Constant
import dotty.tools.dotc.core.Types.{ExprType, NoType, MethodType}
import dotty.tools.dotc.core.Names.Name
-import dotty.runtime.LazyVals
+import dotty.runtime.{LazyVals => RLazyVals} // dotty deviation
import SymUtils._
import scala.collection.mutable.ListBuffer
import dotty.tools.dotc.core.Denotations.SingleDenotation
@@ -288,7 +288,7 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
val thiz = This(claz)(ctx.fresh.setOwner(claz))
val companion = claz.companionModule
val helperModule = ctx.requiredModule("dotty.runtime.LazyVals")
- val getOffset = Select(ref(helperModule), LazyVals.Names.getOffset.toTermName)
+ val getOffset = Select(ref(helperModule), RLazyVals.Names.getOffset.toTermName)
var offsetSymbol: TermSymbol = null
var flag: Tree = EmptyTree
var ord = 0
@@ -296,7 +296,7 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
// compute or create appropriate offsetSymol, bitmap and bits used by current ValDef
appendOffsetDefs.get(companion.name.moduleClassName) match {
case Some(info) =>
- val flagsPerLong = 64 / LazyVals.BITS_PER_LAZY_VAL
+ val flagsPerLong = 64 / RLazyVals.BITS_PER_LAZY_VAL
info.ord += 1
ord = info.ord % flagsPerLong
val id = info.ord / flagsPerLong
@@ -327,11 +327,11 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
val containerTree = ValDef(containerSymbol, initValue(tpe))
val offset = Select(ref(companion), offsetSymbol.name)
- val getFlag = Select(ref(helperModule), LazyVals.Names.get.toTermName)
- val setFlag = Select(ref(helperModule), LazyVals.Names.setFlag.toTermName)
- val wait = Select(ref(helperModule), LazyVals.Names.wait4Notification.toTermName)
- val state = Select(ref(helperModule), LazyVals.Names.state.toTermName)
- val cas = Select(ref(helperModule), LazyVals.Names.cas.toTermName)
+ val getFlag = Select(ref(helperModule), RLazyVals.Names.get.toTermName)
+ val setFlag = Select(ref(helperModule), RLazyVals.Names.setFlag.toTermName)
+ val wait = Select(ref(helperModule), RLazyVals.Names.wait4Notification.toTermName)
+ val state = Select(ref(helperModule), RLazyVals.Names.state.toTermName)
+ val cas = Select(ref(helperModule), RLazyVals.Names.cas.toTermName)
val accessor = mkThreadSafeDef(x.symbol.asTerm, claz, ord, containerSymbol, rhs, tpe, offset, getFlag, state, cas, setFlag, wait)
if(flag eq EmptyTree)