diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-08 13:51:53 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-08 13:51:53 +0200 |
commit | 0584e0ff783419b927145509f8c1dfea5e0510f4 (patch) | |
tree | bca44829607fc8b6fdf01e17fabd96444d547aac /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 2ce940ad11786aae4486f37fb5f17bfc4d6e6589 (diff) | |
download | dotty-0584e0ff783419b927145509f8c1dfea5e0510f4.tar.gz dotty-0584e0ff783419b927145509f8c1dfea5e0510f4.tar.bz2 dotty-0584e0ff783419b927145509f8c1dfea5e0510f4.zip |
New SymDenotation method: expandedName.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 9c6dde798..d2b0d5030 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -286,6 +286,13 @@ object SymDenotations { // ------ Names ---------------------------------------------- + /** The expanded name of this denotation. */ + final def expandedName(implicit ctx: Context) = + if (is(ExpandedName) || isConstructor) name + else name.expandedName(initial.asSymDenotation.owner) + // need to use initial owner to disambiguate, as multiple private symbols with the same name + // might have been moved from different origins into the same class + /** The name with which the denoting symbol was created */ final def originalName(implicit ctx: Context) = { val d = initial.asSymDenotation @@ -1081,11 +1088,7 @@ object SymDenotations { def ensureNotPrivate(implicit ctx: Context) = if (is(Private)) copySymDenotation( - name = - if (is(ExpandedName) || isConstructor) this.name - else this.name.expandedName(initial.asSymDenotation.owner), - // need to use initial owner to disambiguate, as multiple private symbols with the same name - // might have been moved from different origins into the same class + name = expandedName, initFlags = this.flags &~ Private | ExpandedName) else this } |