[SI-5760] Improve error message for package$Klass conflict with Klass Created: 04/May/12  Updated: 05/Jan/13  Resolved: 22/May/12

Status: CLOSED
Project: Scala Programming Language
Component/s: Compiler (Misc)
Affects Version/s: Scala 2.10.0
Fix Version/s: Scala 2.10.0-M3, Scala 2.10.0

Type: Improvement Priority: Major
Reporter: A. P. Marki Assignee: A. P. Marki
Resolution: Fixed Votes: 0
Labels: error-messages


If I follow the warning recommendation and move a class out of a package object, then recompile without cleaning, I get a generic, tautological error message:

pkgobjection.scala:9: error: NoLongerImplementedError is already defined as class NoLongerImplementedError

It would be nicer to specify: "...as class NoLongerImplementedError in package object pkgobjection."

I've read and understood SI-4344, and I've read and misunderstood SI-4695.

The spec says I should never (for now) let this happen, and maybe it doesn't in a tooled environment.

Comment by A. P. Marki [ 04/May/12 ]

Coincidentally, if I had waited awhile and used a compiler with
I would never have known to repackage my little Error class and encounter this situation until one day my compile failed and someone said:
"-Xlint would have told you not to do that".
Medical research has shown that repeated head slaps can cause mini-concussions, dementia and early demise.

Comment by A. P. Marki [ 21/May/12 ]


However, I was too late to push my hack to partest. Let that be a lesson to us all.

Comment by A. P. Marki [ 22/May/12 ]

adriaanm merged commit f406550

Generated at Fri Oct 19 11:41:06 CEST 2018 using JIRA 7.9.1#79001-sha1:60970b42586a2ec2760ed6cfe825b26961e62b9e.