aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-01 18:24:48 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-01 18:24:48 +0200
commitd5df72a6cbedf740ee76290fb9d7dbcc7678411f (patch)
tree46792b3de7436160ce33744b18983db08109ec7b /src/dotty/tools/dotc/core/SymDenotations.scala
parent661068a331eaba1737b4b27e87a09d12e8595045 (diff)
downloaddotty-d5df72a6cbedf740ee76290fb9d7dbcc7678411f.tar.gz
dotty-d5df72a6cbedf740ee76290fb9d7dbcc7678411f.tar.bz2
dotty-d5df72a6cbedf740ee76290fb9d7dbcc7678411f.zip
New method for SymDenotations: ensureNotPrivate
Resets private flag, and expands the name if necessary.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala7
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