[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


 Description   

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.



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

Coincidentally, if I had waited awhile and used a compiler with
8068e1208466ab17af40c2670230ba5ac9704e0c,
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 ]

https://github.com/scala/scala/pull/593

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 Tue May 22 18:05:59 CEST 2018 using JIRA 7.9.1#79001-sha1:60970b42586a2ec2760ed6cfe825b26961e62b9e.