3 ms·
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
by _flux 5y ago
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!
- jwalton 5y agoThat is a very good point.