3 ms·
> it doesn't satisfy the Liskov substitution principle I haven't seen that principle applied so stringently before. Under a strict interpretation it wouldn't
by titzer 4y ago
> it doesn't satisfy the Liskov substitution principle
I haven't seen that principle applied so stringently before. Under a strict interpretation it wouldn't be allowed to override methods with any implementation that didn't have observably equivalent behavior.
> I started passing parameterized interfaces next to instances of that type parameter
This is just manual reification, and it's only skin deep. You still can't do List<Foo>[] because Java's builtin array types can't be polymorphic or extended with fields to store classes representing the reification.