summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2008-03-18 16:27:28 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2008-03-18 16:27:28 +0000
commitacfef3a473ce8b2f136c8e30eb1678510f5b29a7 (patch)
tree22f979337ac7532672e106a479e6ae374fa37523
parentc6d7eeb63f8da7126512b9f9e21ad5ce54b24dd3 (diff)
downloadscala-acfef3a473ce8b2f136c8e30eb1678510f5b29a7.tar.gz
scala-acfef3a473ce8b2f136c8e30eb1678510f5b29a7.tar.bz2
scala-acfef3a473ce8b2f136c8e30eb1678510f5b29a7.zip
Scalac prints a “type is already defined as“ e...
Scalac prints a “type is already defined as“ error instead of incredibly-hard-to-debug “illegal cyclic reference” error in some rare cases.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index b9ce2d8923..b3538763d7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -195,7 +195,7 @@ trait Namers { self: Analyzer =>
def enterClassSymbol(tree : ClassDef): Symbol = {
var c: Symbol = context.scope.lookup(tree.name);
- if (!inIDE && c.isType && context.scope == c.owner.info.decls && !currentRun.compiles(c)) {
+ if (!inIDE && c.isType && c.owner.isPackageClass && context.scope == c.owner.info.decls && !currentRun.compiles(c)) {
updatePosFlags(c, tree.pos, tree.mods.flags)
setPrivateWithin(tree, c, tree.mods)
} else {