Why can't I use existential type for placeholder in generic type?

To be clear, in the general case, this isn't even how the language works—it's just how logic works.

For example, every type that conforms to FixedWidthInteger is a fixed-width integer. Meanwhile, any FixedWidthInteger must be able to hold a value of any conforming type (for example, an Int32 or an Int64). This means that any FixedWidthInteger is not a fixed-width integer. Therefore, it cannot conform to FixedWidthInteger.

12 Likes