Aladdin - Scala Bugtracking
[#687] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-08-02 14:09:28.0
subject confused resident compiler
code
// Used for run 1
package test;

trait Query {
  override def equals(o : Any) = false;
}

// Used for run 2
package test;

trait Query {
  override def equals(o : Object) = false;
}

// Used for run 3
package test;

trait Query {
  override def equals(o : Any) = false;
}
what happened
sean-mcdirmids-computer:~/workspace/test5/src mcdirmid$ ../../scala/build/quick/bin/scalac -resident -sourcepath\
 . -d ../bin/

nsc test/Query.scala

nsc test/Query.scala
test/Query.scala:4 error: name clash between defined and inherited member:
method equals:(java.lang.Object)scala.Boolean and
method equals:(scala.Any)scala.Boolean in class Any
have same type after erasure: (java.lang.Object)scala.Boolean
  override def equals(o : Object) = false;
           ^

nsc test/Query.scala
test/Query.scala:4 error: name clash between defined and inherited member:
method equals:(scala.Any)scala.Boolean and
method equals:error in class Any
have same type
  override def equals(o : Any) = false;
           ^
what expected No error on run 3.
[back to overview]
Changes of this bug report
Martin  edited on  2006-08-23 12:55:02.0