Hacker News new | past | comments | ask | show | jobs | submit login

I wouldn't call it broken duck typing.

The problem is that ShowAbstracts could just modify the array and put an instance of Abstract there that _isn't_ an Impl, thus violating the original constraint of arr containing only instances of Impl.

Once again mutability/invariance raises its ugly head!




That is a very good point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: