diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/Trees.scala | 5 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/models/Signatures.scala | 7 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 8 | ||||
-rw-r--r-- | src/library/scala/collection/Map.scala | 8 |
4 files changed, 23 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index 7e58592361..57967a9294 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -36,6 +36,11 @@ trait Trees requires Global { if (flags1 == flags) this else Modifiers(flags1, privateWithin) setAttr attributes } + def &~ (flag: Int): Modifiers = { + val flags1 = flags & (~flag) + if (flags1 == flags) this + else Modifiers(flags1, privateWithin) setAttr attributes + } def | (flag: int): Modifiers = { val flags1 = flags | flag if (flags1 == flags) this diff --git a/src/compiler/scala/tools/nsc/models/Signatures.scala b/src/compiler/scala/tools/nsc/models/Signatures.scala index b394edc3a4..86a6ed3fd7 100644 --- a/src/compiler/scala/tools/nsc/models/Signatures.scala +++ b/src/compiler/scala/tools/nsc/models/Signatures.scala @@ -48,9 +48,12 @@ class Signatures(val compiler: Compiler) { */ def signature(tree0: Tree, rest: List[Signature]): List[Signature] = tree0 match { case tree: MemberDef => if (!tree.mods.isPrivate) { - val name = "" + tree.name + "::" + tree.mods + val name = "" + tree.name + "::" + + (tree.mods &~ Flags.SYNTHETIC) + val children: List[Signature] = tree match { - case impl: ImplDef => + case impl: ImplDef + if (!impl.name.toString.contains("$anonfun$")) => val supers = new Signature("$$supers", signature(impl.impl.parents)) val body = new Signature("$$body", signature(impl.impl.body)) val ret = supers :: body :: Nil diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index b772ff4ea0..0e118028db 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -323,11 +323,13 @@ trait Infer requires Analyzer { errorTree(tree, underlying(sym).toString() + " cannot be accessed in " + (if (sym.isClassConstructor) context.enclClass.owner else pre.widen) + explanation) - sym.toplevelClass match { + if (context.unit != null) sym.toplevelClass match { case clazz : ClassSymbol => // System.err.println("TOP: " + clazz + " " + clazz.sourceFile) - if (clazz.sourceFile ne null) - global.currentRun.currentUnit.depends += clazz.sourceFile + if (clazz.sourceFile != null) { + context.unit.depends += clazz.sourceFile + //Console.println("DEPEND " + global.currentRun.currentUnit + " ON " + clazz.sourceFile + " XXX " + context.unit) + } case _ => } diff --git a/src/library/scala/collection/Map.scala b/src/library/scala/collection/Map.scala index 211158f047..ad3dc29380 100644 --- a/src/library/scala/collection/Map.scala +++ b/src/library/scala/collection/Map.scala @@ -76,6 +76,14 @@ trait Map[A, +B] extends AnyRef case Some(_) => true } + /** @return the keys of this map as a set. + */ + def keySet = new Set[A] { + def size = Map.this.size; + def contains(key : A) = Map.this.contains(key); + def elements = Map.this.elements.map(._1); + } + /** Does this map contain a mapping from the given key to a value? * * @param key the key |