Avatar
Avatar
Kuniwak
@swift-main enum Foo { case foo(baz: Int) case foo(bar: Int) // NO ERROR!!!! } let foo: Foo = .foo(baz: 0) switch foo { case .foo(baz: let baz): print(baz.description) case .foo(bar: let bar): // ERROR print(bar.description) }
swiftNightly BOT 6/12/2024 6:30 AM
exit status: 1 with <stdin>:8:11: error: tuple pattern element label 'baz' must be 'bar' 6 | let foo: Foo = .foo(baz: 0) 7 | switch foo { 8 | case .foo(baz: let baz): | `- error: tuple pattern element label 'baz' must be 'bar' 9 | print(baz.description) 10 | case .foo(bar: let bar): // ERROR