- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: Re: Re : Type Erasure
Wed, 2011-06-15, 08:18
Sorry I was a little bit quick to reply.
And BTW I came to same wish as you, it would be great to do uniform
pattern matching ;)
But I dont see simple solution without cost here.
On Tue, Jun 14, 2011 at 8:49 PM, Angelo Corsaro wrote:
> Hello Alexis,
>
> On Jun 14, 11:00 am, Alexis Agahi wrote:
>> Quote for Programming in Scala 2nd Edition page 322 ;)
>> "The only exception to the erasure rule is arrays, because they are handled
>> specially in Java as well as in Scala. The element type of an array is
>> stored with the array value, so you can pattern match on it."
>
> I understand that as briefly mentioned (in parentheses) on my previous
> email -- yet, my point remains.
>
> If we ignore for one second the limitations imposed by the JVM (we can
> work around some of those), there is currently a non-uniform way of
> doing pattern matching on parametric types. My point was that for at
> least Scala Library and scala parametric classes the compiler could
> automatically inject a manifest as an hidden attributed and use this
> to make things works in presence of erasure.
>
> Cheers,
> Angelo
>
>