Closed sunfishcode closed 10 months ago
That's an interesting idea, let's tag it as an enhancement and consider it when we're defining/implementing value-level subtyping properly. As #229 suggests, in a preview2 timeframe, we're starting without any value-level subtyping, so probably we'll want to consider in detail the forms of subtyping we do want to allow as a post-preview2 batch.
I'll close for now, since subtyping is generally removed from the C-M repo (#255), but we can revisit when we properly treat subtyping in the future. (Feel free to file a new issue to document the idea that we can tag appropriately.)
I was exploring some hypothetical use cases where it'd be nice to migrate from an
enum
, "pick one of these", to aflags
, "pick any number of these".For example given these types:
The proposal is
berry-enum <: berry-flags
.I know that the subtyping rules aren't currently a focus, and that they may change when the time does come to focus on them, but I wanted to add this idea to the list so that it's considered.