Avatar
Avatar
Iceman
@swift-main enum Foo { case foo(baz: Int) case foo(bar: Int) // NO ERROR!!!! } func f(a: Foo) { switch a { case .foo(let baz): print("baz") case .foo(let bar): print("bar") } } f(a: Foo.foo(baz: 1)) f(a: Foo.foo(bar: 1))
swiftNightly BOT 6/12/2024 6:39 AM
exit status: 132 with <stdin>:10:10: warning: case is already handled by previous patterns; consider removing it 8 | case .foo(let baz): 9 | print("baz")
5.96 KB