diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-01 18:24:48 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-01 18:24:48 +0200 |
commit | d5df72a6cbedf740ee76290fb9d7dbcc7678411f (patch) | |
tree | 46792b3de7436160ce33744b18983db08109ec7b | |
parent | 661068a331eaba1737b4b27e87a09d12e8595045 (diff) | |
download | dotty-d5df72a6cbedf740ee76290fb9d7dbcc7678411f.tar.gz dotty-d5df72a6cbedf740ee76290fb9d7dbcc7678411f.tar.bz2 dotty-d5df72a6cbedf740ee76290fb9d7dbcc7678411f.zip |
New method for SymDenotations: ensureNotPrivate
Resets private flag, and expands the name if necessary.
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 31f6745ef..9b9283464 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1049,6 +1049,13 @@ object SymDenotations { */ override def transformAfter(phase: DenotTransformer, f: SymDenotation => SymDenotation)(implicit ctx: Context): Unit = super.transformAfter(phase, f) + + def ensureNotPrivate(implicit ctx: Context) = + if (is(Private)) + copySymDenotation( + name = if (is(ExpandedName) || isConstructor) this.name else this.name.expandedName(owner), + initFlags = this.flags &~ Private | ExpandedName) + else this } /** The contents of a class definition during a period |