Open hackwaly opened 7 months ago
Existential type is better. Trait object just complex the semantics.
Existential type can achieve trait object.
struct TraitObj { type T : TraitA value : T }
And something hard to achieve if there's only trait object
struct ReactElement { type Props props : Props type_ : ComponentType<Props> }
Existential type is better. Trait object just complex the semantics.
Existential type can achieve trait object.
And something hard to achieve if there's only trait object