Enum cases as static read only properties


(Nico Lehmann) #1

When conforming to a protocol I think cases in an enum can be seen as a static read-only property. I'd expect the following code to compile.

protocol P {
    static var a: Self { get }
}
enum E: P {
    case a
}

(Matt Diephouse) #2

There’s an open bug for this. :blush:
https://bugs.swift.org/browse/SR-3170