| [#462] | project: nsc | priority: medium | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Iulian | _ | fixed | 2005-10-18 11:26:12.0 | |
| subject | [nsc] Erasure introduces erronous casts | |||
| code |
class Foo {
def test(n: Int) = 4.asInstanceOf[Char];
}
|
|||
| what happened | [[syntax trees at end of erasure]]// Scala source: box.scala package |
|||
| what expected | The box is unnecessary, the cast should be treated in the backend as a value conversion from int to char. The boxing introduces a ClassCastException at runtime, because BoxedInt is not an (Boxed)Char. | |||
| [back to overview] | ||||
| Iulian edited on 2005-10-18 13:35:04.0 |
| Iulian edited on 2005-10-18 14:14:47.0 |
| Iulian edited on 2005-11-04 10:37:23.0 |