Swift 2b2: enum case functions do not satisfy protocol requirements
| Originator: | rix.rob | ||
| Number: | rdar://21509789 | Date Originated: | 23-Jun-2015 04:20 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-beta (7A121l) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
enum cases are now functions (thank you!), but protocol conformance checking hasn’t caught on yet.
Steps to Reproduce:
1. This code:
protocol P {
func C(Int) -> Self
}
enum E: P {
case C(Int)
}
Expected Results:
should compile
Actual Results:
but errors:
boom.swift:5:6: error: type 'E' does not conform to protocol 'P'
enum E: P {
^
boom.swift:2:7: note: protocol requires function 'C' with type '(Int) -> Self'
func C(Int) -> Self
^
boom.swift:6:7: note: candidate is not a function
case C(Int)
^
Regression:
N/A
Notes:
N/A
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!