Aladdin - Scala Bugtracking
[#313] project: compiler priority: low category: bug
submitter assigned to status date submitted
Michel Martin fixed 2004-03-23 09:20:09.0
subject Compilation order can dramatically change compiler's behaviour
code
// File bug.scala
import scala.collection.mutable._;

class A {
  val b: B = null;
  def meth(one: int, s: HashSet[int]): Unit = ();
}

// File bug2.scala
import scala.collection.mutable._;

class B {
  def meth(one: int, s: HashSet[int]): Unit = ();
}
what happened
If you compile both files together in the given order (bug.scala and then bug2.scala), you get the following err\
or:
cannotfind $ ~/projects/scala-stable/bin/scalac -d /tmp/ms/classes/ bug.scala bug2.scala 
bug2.scala:4: not found: type HashSet
  def meth(one: int, s: HashSet[int]): Unit = ();
                        ^
one error found
But if you compile them together starting with bug2, then it works.
what expected Iulian (who found that) and I expect the two files to be compilable in any order.
[back to overview]
Changes of this bug report
Martin  edited on  2004-04-08 19:41:45.0
I reclassified to low, because the bug only happens if you compile several files which do not have a package clause and which refer to each other. This is clearly something you should not do.
Martin  edited on  2004-07-02 14:03:03.0