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-3170 Enum cases should satisfy static var {get} protocol requirements
Issue Description:
I would like to use enum's case to conform to protocol.
I would be happy even if only the first example was possible...
// Example 1
protocol ShapeCreator {
static func objectWith(area: Int) -> Self
}
enum TheCreator: ShapeCreator {
case objectWith(area: Int)
}
TheCreator.objectWith(area: 99)
// Example 2
protocol ShapeCreator {
static var defaultCreator: Self { get }
func createStuff()
}
enum CreatorWithDefault: ShapeCreator {
case defaultCreator
func createStuff()
}
CreatorWithDefault.defaultCreator.createStuff()
// Example 3
// This probably is a bit of a stretch
protocol ShapeCreator {
static var defaultArea: Int
}
enum Default: Int, ShapeCreator {
case defaultArea = 100
}
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 58619f930d98188e216158a195bf28e0
duplicates:
Issue Description:
I would like to use enum's case to conform to protocol.
I would be happy even if only the first example was possible...
The text was updated successfully, but these errors were encountered: