Skip to content

Numeric types should satisfy the Add trait #3980

Closed
@bstrie

Description

@bstrie

Right now if you write a generic implementation on all types that implement Add, like so:

impl<T: Copy Add<T,T>> Option<T> : Add<Option<T>, Option<T>> {

...attempting to use the implementation on numeric types fails because they haven't technically implemented Add. There should probably be some compiler magic to ensure that numeric types satisfy such generic bounds, even if they don't technically implement the trait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions