| [#229] | project: compiler | priority: medium | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Stephane | Martin | fixed | 2003-11-18 14:01:38.0 | |
| subject | error overriding method | |||
| code | class Test extends java.util.ArrayList {
  override def add(index: Int, element: java.lang.Object) = {}
} | |||
| what happened |  | |||
| what expected | No error (same example works fine in Java) | |||
| [back to overview] | ||||
| Martin edited on 2004-01-08 15:43:19.0 | 
| Philippe edited on 2004-09-24 13:35:20.0 | 
| I reopend this bug because on lampsun1 this example produces the following error: 
/home/paltherr/work/scala-cvs/test/files/pos/bug229.scala:2: Accidental override:
method add: (scala.Int,java.lang.Object)scala.Unit has same type after erasure as
method add: (scala.Int,scala.Any)scala.Unit which is inherited from class ArrayList
  override def add(index: int, element: java.lang.Object): unit = {}
               ^
one error found
There is no error on the lamppcs. This difference is probably due to the fact that the pcs and the sun run two different versions of java: 1.4.2_05-b04 for the pcs and 1.4.1_02-b06 for the sun. | 
| Martin edited on 2006-03-30 19:01:09.0 |