New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for package$Klass conflict with Klass #5760

Closed
scabug opened this Issue May 3, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@scabug
Copy link

scabug commented May 3, 2012

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 #4344, and I've read and misunderstood #4695.

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

@scabug

This comment has been minimized.

Copy link

scabug commented May 3, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5760?orig=1
Reporter: @som-snytt
Affected Versions: 2.10.0
Other Milestones: 2.10.0

@scabug

This comment has been minimized.

Copy link

scabug commented May 4, 2012

@som-snytt said:
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.

@scabug

This comment has been minimized.

Copy link

scabug commented May 21, 2012

@som-snytt said:
scala/scala#593

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

@scabug

This comment has been minimized.

Copy link

scabug commented May 22, 2012

@som-snytt said:
adriaanm merged commit f406550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment