Skip to content

false errors on methods from non implemented traits #5419

@arturoc

Description

@arturoc

Sometimes function calls on objects that have a method implementation are taken as coming from a trait that is not really implemented by that struct and marked as an error do to incorrect arguments.

For example a struct that has an impl like:

impl Gui {
    fn fold() {
    }
}

will show errors on gui.fold() reporting it as Iterator::fold as missing two arguments. Iterator is not implemented for that struct.

The problem arises, I think, when the type for the variable can't be resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions