swiftlang/swift

[SR-7151] Generalize CaseIterable Synthesis for Availability

Open

#49,699 opened on Mar 9, 2018

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Swift (10,719 forks)batch import
compilerderived conformancesfeaturegood first issueimprovement

Repository metrics

Stars
 (69,989 stars)
PR merge metrics
 (Avg merge 8d 17h) (510 merged PRs in 30d)

Description

Previous ID SR-7151
Radar rdar://problem/43569215
Original Reporter @CodaFi
Type Improvement
Status In Progress
Resolution
Votes 2
Component/s Compiler
Labels Improvement, StarterBug
Assignee None
Priority Medium

md5: 508eab090d1f0026b4428b290a2d40be

relates to:

  • SR-9094 Unavailable enum case with synthesized raw value causes error

Issue Description:

As of this issue, the current implementation of SE-0194 does not synthesize a conformance if any cases contain an availability attribute. This restriction may be lifted at any time by an implementation that maintains the source-order invariant.

enum Rhapsody: CaseIterable {
  @available(*, unavailable)
  case inBlue 
  case hungarian, bohemian
  @available(*, deprecated)
  case onATheme
}
Rhapsody.allCases // [hungarian, bohemian, onATheme] 

Contributor guide