Hacker News new | ask | show | jobs
by reginaldo 5192 days ago
Yes, you're right. We're talking about variance when it comes to the "? extends, ? super" situation, not erasure. And you're also right the things would be better with definition-site variance.

On the other hand, sometimes I think an unsound type system with List<String> being a subtype of List<Object> would be better than what we have today, for pragmatic reasons. Of course, I think this makes me a non-type-theorist, as what I'm saying is considered heresy in some circles [1].

[1] http://lambda-the-ultimate.org/node/4377 (search for unsound).

1 comments

But than you can never get anything from List<String>! Because you never know what type are you getting!

On the other hand, if your structure is immutable it would probably work.