-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Closed
Copy link
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfparserArea → compiler: The legacy C++ parserArea → compiler: The legacy C++ parser
Description
Previous ID | SR-1660 |
Radar | None |
Original Reporter | Wheerd (JIRA User) |
Type | Bug |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 1 |
Component/s | Compiler |
Labels | Bug, Parser |
Assignee | None |
Priority | Medium |
md5: 5665fa3f90e5789f42eca1cf46a3fc49
is duplicated by:
- SR-6959 can't use
init
as a enum case with associated values
relates to:
- SR-6557
init
case of enum can be used implicitly
Issue Description:
The following program results in a compile time error, because the generated rawValue initializer interferes with the `init` case:
enum Test : String {
case `init`
}
The compiler gives the following error message:
<unknown>:0: error: invalid redeclaration of 'init(rawValue:)'
INFO at line 5, col 10: 'init' previously declared here
case `init`
^
From my understanding, this enum should work perfectly fine, as that is what the backtick escapes are supposed to prevent.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfparserArea → compiler: The legacy C++ parserArea → compiler: The legacy C++ parser