| [#100] | project: compiler | priority: high | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Matthias | Michel | fixed | 2003-09-02 15:44:27.0 | |
| subject | Illegal code (array related?) | |||
| code |
object FOO {
def foo(x: scala.Object) = {
System.out.println(x.isInstanceOf[scala.Object]);
}
def main(args: Array[String]) = {
foo(args);
}
} |
|||
| what happened | Compiles, but is not executable. The verifier complains:
|
|||
| what expected | Compiler, runtime positive? Maybe we should reconsider to place arrays at a different place in the inheritance hierarchy. I would have guessed that they are direct subclasses of AnyRef. But obviously, they are subclasses of scala.Object. This is really a bit weired, because in Java they are direct subtypes of java.lang.Object. |
|||
| [back to overview] | ||||
| Matthias edited on 2003-09-02 15:45:06.0 |
| Shall we celebrate bug number 100? ;-) |
| Burak edited on 2003-09-23 18:29:23.0 |
| changed priority. let's rather celebrate fixed bug number 100 ! |
| Michel edited on 2003-09-29 17:11:11.0 |
Currently, the class scala.Array is a subclass of java.lang.Object, which is apparently not what the typechecker belives. A simple fix for this bug is therefore to change scala.Array to make it inherit from scala.Object and this is what I did. But we should discuss that further.
|