swiftlang/swift

[SR-7151] Generalize CaseIterable Synthesis for Availability

Open

#49.699 aperta il 9 mar 2018

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)Swift (10.719 fork)batch import
compilerderived conformancesfeaturegood first issueimprovement

Metriche repository

Star
 (69.989 star)
Metriche merge PR
 (Merge medio 8g 17h) (510 PR mergiate in 30 g)

Descrizione

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] 

Guida contributor