Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


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

Simn opened this Issue · 1 comment

1 participant

Simon Krajewski
Simon Krajewski
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.

Simon Krajewski Simn self-assigned this
Simon Krajewski

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.

Simon Krajewski Simn closed this in e04d6f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.