[swift-users] Argument labels
Erica Sadun
erica at ericasadun.com
Mon Oct 10 22:44:02 CDT 2016
This goes beyond type significance as far as I can tell.
Bug report?
-- E
enum Sample { case foo(Int), bar(label: Int) }
let aFoo: Sample = .foo(1)
let aBar: Sample = .bar(label: 1) // requires label
if case let .foo(value) = aFoo { print(value) } // works
if case let .bar(value) = aBar { print(value) } // works
if case let .foo(label: value) = aFoo { print(value) } // works
if case let .bar(label: value) = aBar { print(value) } // works
More information about the swift-users
mailing list