Anyone else getting this? It works in a playground but in a normal source file, I'm getting the error. Some others say they can't reproduce it.
The error is on line 14: Incorrect argument label in call (have 'rawValue:', expected 'name:')
enum Foo : Int {
case A, B
init?(name:String) {
switch name {
case "A": self = .A
case "B": self = .B
default: return nil
}
}
}
let foo = Foo.A
let foo2 = Foo(rawValue:2)! // error