swiftlang/swift

[SR-7151] Generalize CaseIterable Synthesis for Availability

Open

#49,699 创建于 2018年3月9日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Swift (10,719 fork)batch import
compilerderived conformancesfeaturegood first issueimprovement

仓库指标

Star
 (69,989 star)
PR 合并指标
 (平均合并 8天 17小时) (30 天内合并 510 个 PR)

描述

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] 

贡献者指南