4 ms·
The difference is subtypes being treated as super types, ie, OOP stuff. Type erasure is different in a language where basically any typed value could also conta
by shlurpy 5y ago
The difference is subtypes being treated as super types, ie, OOP stuff. Type erasure is different in a language where basically any typed value could also contain a value of any subtype. All those other languages you mention make that functionality opt in, which is why they aren't object oriented languages.
- mumblemumble 5y agoOne could imagine, though, an object-oriented language that doesn't retain objects' actual types, just pointers to their virtual function tables. Perhaps, as an optimization, it even skips that in cases where it can prove that all method calls can be statically dispatched.