summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-10-09 19:06:26 +0200
committerMartin Odersky <odersky@gmail.com>2012-10-09 19:06:26 +0200
commitbf0e26c04577690bc15dd08eeb706ba0f6fa4cf4 (patch)
tree534a677ace9f9293cab5e27c3dfe8a12da9d0d50 /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parent7ca76c8b3bef2d46333b4571806b126533239cda (diff)
downloadscala-bf0e26c04577690bc15dd08eeb706ba0f6fa4cf4.tar.gz
scala-bf0e26c04577690bc15dd08eeb706ba0f6fa4cf4.tar.bz2
scala-bf0e26c04577690bc15dd08eeb706ba0f6fa4cf4.zip
Proposed fix for SI-6490.
Issues a "companions must be in same file" error only if both class and module exist. This can certainly do no harm. I believe it should adress SI-6490, but, lacking a test case, I don't have evidence for that.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 1b2225f5f2..a37dc77d44 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -377,6 +377,8 @@ trait Namers extends MethodSynthesis {
&& (clazz.sourceFile ne null)
&& (module.sourceFile ne null)
&& !(module isCoDefinedWith clazz)
+ && module.exists
+ && clazz.exists
)
if (fails) {
context.unit.error(tree.pos, (