diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-01 18:49:06 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-01 18:49:06 +0200 |
commit | 592f2d50a18637d79cbba4f1a28f32cda3822ffe (patch) | |
tree | caf37d5e502f9b9e6043de34fd90a76829462cda /src | |
parent | 55c7232696040a68816f8958ddae3411faab33cb (diff) | |
download | dotty-592f2d50a18637d79cbba4f1a28f32cda3822ffe.tar.gz dotty-592f2d50a18637d79cbba4f1a28f32cda3822ffe.tar.bz2 dotty-592f2d50a18637d79cbba4f1a28f32cda3822ffe.zip |
Expand name should use initial owner.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 9b9283464..e62fccdc4 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1050,10 +1050,15 @@ object SymDenotations { override def transformAfter(phase: DenotTransformer, f: SymDenotation => SymDenotation)(implicit ctx: Context): Unit = super.transformAfter(phase, f) + /** If denotation is private, remove the Private flag and expand the name if necessary */ def ensureNotPrivate(implicit ctx: Context) = if (is(Private)) copySymDenotation( - name = if (is(ExpandedName) || isConstructor) this.name else this.name.expandedName(owner), + 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 initFlags = this.flags &~ Private | ExpandedName) else this } |