3 ms·
Ehm, no? You can’t pass Dog[] where Animal[] is expected, it’s one of the more interesting properties of the Array, because its the only case where that doesn’
by kuschku 10y ago
Ehm, no?
You can’t pass Dog[] where Animal[] is expected, it’s one of the more interesting properties of the Array, because its the only case where that doesn’t work.
For the exact reason you mentioned.
- aioprisan 10y agoLooks like you missed the gist of the post, then. Code it up, you'll see it in action very clearly.
- AnimalMuppet 10y agoI believe you missed the GP's point. It's not that "you can't because the language stops you", it's that "you can't because it doesn't work". That is, you're agreeing, not disagreeing.
- pvg 10y agoTry it. http://ideone.com/hJa0yf http://ideone.com/hJa0yf