Scala Programming Language
  1. Scala Programming Language
  2. SI-5939

Resident compiler: sources in the empty package with dependencies

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M5
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      The resident compiler fails when used with the `-Yinvalidate` option and sources in the empty package that use an external dependency.

      A.scala

      import scalaz._
      import Scalaz._
      object A {
        def dummyDependency = true.fold(false, true)
      }
      

      B.scala is the same as A.scala but with `object B` (it just needs to be in the empty package and use the dependency).

      $ mkdir build
      $ fsc -d build -Yinvalidate build -classpath build:scalaz-core.jar A.scala B.scala
      $ rm -rf build/A*.class
      $ fsc -d build -Yinvalidate build -classpath build:scalaz-core.jar A.scala
      error while loading Scalaz, class file
       '.../scalaz-core.jar(scalaz/Scalaz.class)'
       has location not matching its contents: contains class Scalaz
      

      If you repeat the process, but with the sources in 'package example', no error occurs. I used scalaz 6.0.4, but the specific dependency does not appear to be important. It just needs to be from an external jar (not the standard library).

        Activity

        Show
        Adriaan Moors added a comment - https://github.com/scala/scala/pull/943

          People

          • Assignee:
            Martin Odersky
            Reporter:
            Mark Harrah
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development