You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, inheritance is not very compatible with Rust's way of defining implementations of traits, as the following example shows. If one wants to generally implement the trait AB in Rust, one can do:
The text was updated successfully, but these errors were encountered:
yannbolliger
changed the title
Trait bouns on other traits AKA type class inheritance/composition
Trait bounds on other traits AKA type class inheritance/composition
Mar 29, 2021
Currently, trait bounds on traits are extracted as an inheritance relationship of the extracted abstract classes:
results in
However, inheritance is not very compatible with Rust's way of defining implementations of traits, as the following example shows. If one wants to generally implement the trait
AB
in Rust, one can do:which currently results in:
But, that is not accepted by Stainless with the following error:
Therefore, it would be more practical to handle trait bounds on traits with composition:
The text was updated successfully, but these errors were encountered: