Skip to content

Improve method selection to make short-circuiting clear #1534

Open
@traviscross

Description

@traviscross

Method resolution has two steps. We collect a list of types, then we go through that list and, for each type, look to see whether there's one or more matching methods. If we find multiple matching trait methods, that's an error. But otherwise, we stop if we find one.

What we don't do is continue down the list of types after finding a matching method. In PR #1394 this was brought up. We weren't happy with the fix, but this is something we should think about when reworking this language.

See also:

cc @ehuss

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions