diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-21 08:20:35 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-21 08:20:35 -0700 |
commit | f406550146250f5a6036d3d778582efa6d68252a (patch) | |
tree | a1248bb164c0bd83117c13c113e117e02b43a6a1 /src/compiler | |
parent | 79e3cf338333e61ba1d0d03a1cfe5558718cf539 (diff) | |
parent | 01c673efd80d687b6ba3cec09059a024cec6e7c2 (diff) | |
download | scala-f406550146250f5a6036d3d778582efa6d68252a.tar.gz scala-f406550146250f5a6036d3d778582efa6d68252a.tar.bz2 scala-f406550146250f5a6036d3d778582efa6d68252a.zip |
Merge pull request #593 from som-snytt/ticket/5760-pkgobj-warn
SI-5760: Improve error message for package$Klass conflict with Klass
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index cb01faf619..eb3a1ffb5b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -874,8 +874,12 @@ trait ContextErrors { val s1 = if (prevSym.isModule) "case class companion " else "" val s2 = if (prevSym.isSynthetic) "(compiler-generated) " + s1 else "" val s3 = if (prevSym.isCase) "case class " + prevSym.name else "" + prevSym + val where = if (currentSym.owner.isPackageClass != prevSym.owner.isPackageClass) { + val inOrOut = if (prevSym.owner.isPackageClass) "outside of" else "in" + " %s package object %s".format(inOrOut, ""+prevSym.effectiveOwner.name) + } else "" - issueSymbolTypeError(currentSym, prevSym.name + " is already defined as " + s2 + s3) + issueSymbolTypeError(currentSym, prevSym.name + " is already defined as " + s2 + s3 + where) } def MaxParametersCaseClassError(tree: Tree) = |