aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-13 14:11:44 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-13 14:11:44 +0100
commit3c7a8eada3630989b07bd3022797fd42a3b8cfcc (patch)
tree0036fee8aa025e3eea8502ea08f413f6baec3a56 /src/dotty/tools/dotc/core/SymDenotations.scala
parentd1794c15f5a5743763adeb8f8e248f9ca5f53869 (diff)
downloaddotty-3c7a8eada3630989b07bd3022797fd42a3b8cfcc.tar.gz
dotty-3c7a8eada3630989b07bd3022797fd42a3b8cfcc.tar.bz2
dotty-3c7a8eada3630989b07bd3022797fd42a3b8cfcc.zip
Various fixes to get past Definitions#init.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 68aa2f0fa..1bbeb1009 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -51,6 +51,9 @@ object SymDenotations {
private[this] var _privateWithin: Symbol = initPrivateWithin
private[this] var _annotations: List[Annotation] = Nil
+ if (isType) assert(_flags.toTypeFlags == _flags, this.name + " " + _flags)
+ if (isTerm) assert(_flags.toTermFlags == _flags, this.name + " " + _flags)
+
/** The owner of the symbol */
def owner: Symbol = _owner
@@ -58,8 +61,11 @@ object SymDenotations {
final def flags: FlagSet = { ensureCompleted(); _flags }
/** Update the flag set */
- private[core] final def flags_=(flags: FlagSet): Unit =
+ private[core] final def flags_=(flags: FlagSet): Unit = {
_flags = flags
+ if (isType) assert(_flags.toTypeFlags == _flags, this.name)
+ if (isTerm) assert(_flags.toTermFlags == _flags, this.name)
+ }
/** Set given flags(s) of this denotation */
final def setFlag(flags: FlagSet): Unit = { _flags |= flags }
@@ -67,14 +73,15 @@ object SymDenotations {
/** UnsSet given flags(s) of this denotation */
final def resetFlag(flags: FlagSet): Unit = { _flags &~= flags }
- final def is(fs: FlagSet) =
+ final def is(fs: FlagSet) = {
(if (fs <= FromStartFlags) _flags else flags) is fs
+ }
final def is(fs: FlagSet, butNot: FlagSet) =
- (if (fs <= FromStartFlags) _flags else flags) is (fs, butNot)
+ (if (fs <= FromStartFlags && butNot <= FromStartFlags) _flags else flags) is (fs, butNot)
final def is(fs: FlagConjunction) =
(if (fs <= FromStartFlags) _flags else flags) is fs
final def is(fs: FlagConjunction, butNot: FlagSet) =
- (if (fs <= FromStartFlags) _flags else flags) is (fs, butNot)
+ (if (fs <= FromStartFlags && butNot <= FromStartFlags) _flags else flags) is (fs, butNot)
/** The type info.
* The info is an instance of TypeType iff this is a type denotation
@@ -88,6 +95,7 @@ object SymDenotations {
private def completedInfo(completer: LazyType): Type = {
if (_flags is CompletionStarted) throw new CyclicReference(this)
_flags |= CompletionStarted
+ println("completing "+this.debugString+"/"+owner.id) // !!! DEBUG
completer.complete(this)
info
}