You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-3510 Allow Enum case to conform to a protocol static function and static variable
SR-9099 Enum case does not satisfy protocol static var
Issue Description:
Outside of pattern-matching, enum cases are used the same way static let properties are. To that end, they should be able to satisfy protocol requirements for static var { get } properties.
unnamed.swift:5:6: error: type 'Baz' does not conform to protocol 'Foo'
enum Baz: Foo {
^
unnamed.swift:2:16: note: protocol requires property 'bar' with type 'Baz'; do you want to add a stub?
static var bar: Self { get }
^
unnamed.swift:6:10: note: candidate is not a variable
case bar
^
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: d9521650445f1899139f2653dbcaffff
is duplicated by:
Issue Description:
Outside of pattern-matching, enum cases are used the same way static let properties are. To that end, they should be able to satisfy protocol requirements for static var { get } properties.
For example:
Right now this gives the following error:
The text was updated successfully, but these errors were encountered: