diff options
author | odersky <odersky@gmail.com> | 2017-04-11 11:49:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 11:49:40 +0200 |
commit | 579571e05a08120133173933e7eaf2555846d1d7 (patch) | |
tree | 7b0c89291126e89a901a8ab1230f874e26e25515 /compiler/src/dotty/tools/dotc/typer/Inliner.scala | |
parent | 4ff656138a2e4e127b763adeee3f0f72d515f6b6 (diff) | |
parent | 87608bded1fb23519a829fa7f6ee14d4b6a515dc (diff) | |
download | dotty-579571e05a08120133173933e7eaf2555846d1d7.tar.gz dotty-579571e05a08120133173933e7eaf2555846d1d7.tar.bz2 dotty-579571e05a08120133173933e7eaf2555846d1d7.zip |
Merge pull request #2128 from dotty-staging/add-semantic-names
Delay name mangling
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Inliner.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Inliner.scala | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index f6d65fbb9..38a139be1 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -13,8 +13,9 @@ import Decorators._ import Constants._ import StdNames.nme import Contexts.Context -import Names.{Name, TermName} +import Names.{Name, TermName, EmptyTermName} import NameOps._ +import NameKinds.{InlineAccessorName, OuterSelectName} import SymDenotations.SymDenotation import Annotations._ import transform.ExplicitOuter @@ -49,8 +50,7 @@ object Inliner { sym.is(AccessFlags) || sym.privateWithin.exists /** The name of the next accessor to be generated */ - def accessorName(implicit ctx: Context) = - ctx.freshNames.newName(inlineMethod.name.asTermName.inlineAccessorName.toString) + def accessorName(implicit ctx: Context) = InlineAccessorName.fresh(inlineMethod.name.asTermName) /** A fresh accessor symbol. * @@ -399,9 +399,6 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) { // The class that the this-proxy `selfSym` represents def classOf(selfSym: Symbol) = selfSym.info.widen.classSymbol - // The name of the outer selector that computes the rhs of `selfSym` - def outerSelector(n: Int): TermName = n.toString.toTermName ++ nme.OUTER_SELECT - // The total nesting depth of the class represented by `selfSym`. def outerLevel(selfSym: Symbol): Int = classOf(selfSym).ownersIterator.length @@ -419,7 +416,7 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) { if (!lastSelf.exists) prefix else - untpd.Select(ref(lastSelf), outerSelector(lastLevel - level)).withType(selfSym.info) + untpd.Select(ref(lastSelf), OuterSelectName(EmptyTermName, lastLevel - level)).withType(selfSym.info) bindingsBuf += ValDef(selfSym.asTerm, rhs) lastSelf = selfSym lastLevel = level |