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.

        Activity

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

        adriaanm merged commit f406550

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development