-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
Union types express a subtyping relationship, but I am unclear as to whether typeclasses (i.e. Rust's traits) do?
If a trait B extends another trait A and B reuses the implementations of A, can we assign a trait object that has a bound B to a trait object that has a bound A?
Seems the answer based on prior discussion is yes. But that is a subtyping relationship, which means we would need to deal with covariance on type parameters both when they are trait objects and when they are unions. Correct?
Prior discussion:
#6 (comment)
#1 (comment)
#2 (comment)
#1 (comment)
Reactions are currently unavailable