[#431] | project: compiler | priority: low | category: bug | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Michel | Martin | won't fix | 2005-05-19 08:59:09.0 | |
subject | asInstanceOf does not perform coercion in some cases | |||
code |
object Main with Application { def f1[T](x: Any): T = x.asInstanceOf[T]; Console.println(f1[Float](42)); // this works def f2(x: Any): Float = x.asInstanceOf[Float]; Console.println(f2(42)); // this crashes } |
|||
what happened | The call to |
|||
what expected | No crash. This problem is due to the double meaning of |
|||
[back to overview] |
Martin edited on 2006-05-08 10:30:33.0 |
Noy applicable to Scala 2 with erasure semantics |