Skip to content

Incorrect matching on tuples with value ranges #12582

Closed
@adwhit

Description

@adwhit

If part of a tuple is already "mentioned" in a match (but the match misses because of the rest of the tuple), it then won't match on a later range either, regardless of whether it should.

Best demonstrated by example:

fn main() {
    let x = 1;
    let y = 2;

    let z = match (x,y) {
    (1,1) => 1,
    (2,2) => 2,
    (1..2,2) => 3,
    (_,_) => fail!("Shouldn't reach here but does")
    };
}

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