Wrong unused pattern detection in tuple matching with or-patterns #2610

Closed
Simn opened this Issue Feb 6, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@Simn
Member

Simn commented Feb 6, 2014

class Main {
    static function main():Void {
        switch [1, 2] {
            case [1, 1]:
            case [1 | 2, 1 | 2]:
            case _:
        }
    }
}

This reports This pattern is unused for the last 1. That's because the pattern is pseudo-extended to case [1, 1], which was previously matched.

This is a regression.

@Simn Simn self-assigned this Feb 6, 2014

@Simn

This comment has been minimized.

Show comment Hide comment
@Simn

Simn Feb 26, 2014

Member

This is going to be my boss battle for 3.1. I probably have to rework the entire unused detection to somehow mark used patterns instead of cases.

Member

Simn commented Feb 26, 2014

This is going to be my boss battle for 3.1. I probably have to rework the entire unused detection to somehow mark used patterns instead of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment