diff options
author | Martin Odersky <odersky@gmail.com> | 2014-09-17 10:03:14 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-10-11 08:24:35 +0200 |
commit | 02ab2e85f4570b53e4eab251f6f6a047fd8d168b (patch) | |
tree | db00f6f150562e0531d3fa57e3a06eeb108fbbfe /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 8918bd94813c254dcd0e19d0c16726bb5450e27a (diff) | |
download | dotty-02ab2e85f4570b53e4eab251f6f6a047fd8d168b.tar.gz dotty-02ab2e85f4570b53e4eab251f6f6a047fd8d168b.tar.bz2 dotty-02ab2e85f4570b53e4eab251f6f6a047fd8d168b.zip |
Add isProperlyContainedIn method
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 1316e7872..ed123a384 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -372,6 +372,9 @@ object SymDenotations { recur(symbol) } + final def isProperlyContainedIn(boundary: Symbol)(implicit ctx: Context): Boolean = + symbol != boundary && isContainedIn(boundary) + /** Is this denotation static (i.e. with no outer instance)? */ final def isStatic(implicit ctx: Context) = (this is Static) || this.exists && owner.isStaticOwner @@ -916,7 +919,7 @@ object SymDenotations { privateWithin: Symbol = null, annotations: List[Annotation] = null)(implicit ctx: Context) = { // simulate default parameters, while also passing implicit context ctx to the default values - val initFlags1 = if (initFlags != UndefinedFlags) initFlags else this.flags &~ Frozen + val initFlags1 = (if (initFlags != UndefinedFlags) initFlags else this.flags) &~ Frozen val info1 = if (info != null) info else this.info val privateWithin1 = if (privateWithin != null) privateWithin else this.privateWithin val annotations1 = if (annotations != null) annotations else this.annotations |