Swift 2b4: No error message for indirect case with empty parens
| Originator: | rix.rob | ||
| Number: | rdar://21927265 | Date Originated: | 21-Jul-2015 04:54 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-beta (7A165t) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
Weird inconsistency in how enum cases are handled.
Steps to Reproduce:
1. This code:
enum A {
indirect case C()
}
Expected Results:
should show an error just like this code does:
enum A {
indirect case C
}
error: enum case 'C' without associated value cannot be 'indirect'
indirect case C
^
Actual Results:
but totally doesn’t.
Regression:
As noted, leaving off the parens nets you the error.
Notes:
This suggests that the compiler doesn’t think of the no-paren case as actually having an associated value of type (), which is semantically alarming.
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!