Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-5760

Improve error message for package$Klass conflict with Klass

    Details

      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.

        Attachments

          Activity

          Hide
          apm A. P. Marki added a comment -

          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.

          Show
          apm A. P. Marki added a comment - 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.
          Hide
          apm A. P. Marki added a comment -

          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.

          Show
          apm A. P. Marki added a comment - 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.
          Hide
          apm A. P. Marki added a comment -

          adriaanm merged commit f406550

          Show
          apm A. P. Marki added a comment - adriaanm merged commit f406550

            People

            • Assignee:
              apm A. P. Marki
              Reporter:
              apm A. P. Marki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: