aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-27 21:55:26 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:11 +0200
commit0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c (patch)
tree89499a1172e48e81a86d61242090819d658c5aa7 /compiler/src/dotty/tools/dotc/transform
parent1d6f5f7f33f9e4be29553cb7ef1e6f054a64dc6b (diff)
downloaddotty-0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c.tar.gz
dotty-0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c.tar.bz2
dotty-0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c.zip
Add ShadowedName and AvoidClashName
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/Erasure.scala3
-rw-r--r--compiler/src/dotty/tools/dotc/transform/FirstTransform.scala4
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
index d64120085..e9fe42e78 100644
--- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
@@ -11,6 +11,7 @@ import core.Types._
import core.Names._
import core.StdNames._
import core.NameOps._
+import core.NameExtractors.ShadowedName
import core.Decorators._
import core.Constants._
import core.Definitions._
@@ -363,7 +364,7 @@ object Erasure extends TypeTestsCasts{
def select(qual: Tree, sym: Symbol): Tree = {
val name = tree.typeOpt match {
- case tp: NamedType if tp.name.isShadowedName => sym.name.shadowedName
+ case tp: NamedType if tp.name.is(ShadowedName) => sym.name.derived(ShadowedName)
case _ => sym.name
}
untpd.cpy.Select(tree)(qual, sym.name)
diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
index 8328e43de..803504944 100644
--- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
+++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
@@ -19,8 +19,8 @@ import dotty.tools.dotc.core.Denotations.SingleDenotation
import scala.collection.mutable
import DenotTransformers._
import typer.Checking
-import Names.Name
import NameOps._
+import NameExtractors.AvoidClashName
import StdNames._
@@ -129,7 +129,7 @@ class FirstTransform extends MiniPhaseTransform with InfoTransformer with Annota
case _ =>
false
}
- val uniqueName = if (nameClash) objName.avoidClashName else objName
+ val uniqueName = if (nameClash) AvoidClashName(objName) else objName
Thicket(stat :: ModuleDef(registerCompanion(uniqueName, stat.symbol), Nil).trees)
case stat => stat
}