Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect indentation of switch with pattern matching #26

Open
taku0 opened this issue Nov 17, 2019 · 0 comments
Open

Incorrect indentation of switch with pattern matching #26

taku0 opened this issue Nov 17, 2019 · 0 comments

Comments

@taku0
Copy link

taku0 commented Nov 17, 2019

Given:

enum Foo {
    case P(x: Int)
}
class A {
    func a() -> Bool {
        return true
    }
}

func foo() {
    switch Foo.P(x: 1) {
    case .P(1)
    where
      A()
        .a():
        print(1)
    case .P(let 2)
           where
             A()
               .a():
        print(2)
    case _:
        print("other")
    }
}

Output:

enum Foo {
    case P(x: Int)
}
class A {
    func a() -> Bool {
        return true
    }
}

func foo() {
    switch Foo.P(x: 1) {
    case .P(1)
        where
        A()
            .a():
            print(1)
        case .P(let 2)
            where
            A()
                .a():
                print(2)
            case _:
                print("other")
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant