2 ms·
One thing that I never understood about Eiffel is why, for all the focus on correctness, it has that gaping hole in its type system in form of catcalls (and IIR
by int_19h 7y ago
One thing that I never understood about Eiffel is why, for all the focus on correctness, it has that gaping hole in its type system in form of catcalls (and IIRC there were also some implicit and not-always-safe variance assumptions for generics?).
I know that Meyer insists that covariant redefinitions are necessary to model the real world. But that's only true with Eiffel's inheritance model intermingling types and implementation! In OCaml, for example, subclasses of a class need not be subtypes; and if you want both subtyping and catcalls, then you parametrize the base class accordingly.
- claudionaoto 7y agoMeyer did not know that the type system was unsound. This was discovered later by Luca Cardelli. Meyer said that he would correct it but it seems that existing libraries used this covariant feature too much and they instead made some ugly hack using whole program analysis.