From 3c7a8eada3630989b07bd3022797fd42a3b8cfcc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 13 Mar 2013 14:11:44 +0100 Subject: Various fixes to get past Definitions#init. --- src/dotty/tools/dotc/core/SymDenotations.scala | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala') 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 } -- cgit v1.2.3