swiftlang/swift

[SR-7151] Generalize CaseIterable Synthesis for Availability

Ouverte

#49 699 ouverte le 9 mars 2018

 (3 commentaires) (0 réaction) (0 personne assignée)Swift (10 719 forks)batch import
compilerderived conformancesfeaturegood first issueimprovement

Métriques du dépôt

Stars
 (69 989 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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] 

Guide contributeur