Hacker News new | ask | show | jobs
by pron 3535 days ago
You'll have to search for a reference (I don't have one off hand), but obviously value types cannot possibly support subclassing. Why is that a bummer? That's how you'd want value types to behave and the only way they can[1] (without introducing explicit pointers and complex typing rules). Also, why would you ever want to subclass value types? It serves no purpose. Value types, however, will be able to implement interfaces, which, also, is exactly what you'd want.

[1]: For example, if B is a subclass of the value type A, what do you think would happen when you store a value of type B in an array of type A?