mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
An `AvailableAttr` written in source with an unrecognized availability domain is now only marked invalid after type-checking the attribute. This resulted in a regression where `CaseIterable` synthesis was blocked incorrectly under the following very narrow circumstances: 1. Every `@available` attribute on the elements of the enum is invalid. 2. The module is being emitted and lazy type-checking is enabled. 3. The enum is public and the only top-level declaration in the file. Type-checking the attribute was delayed just enough that it would not be considered invalid by the type the `CaseIterable` conformance was being synthesized, resulting in a spurious error. There were zero tests exercising `CaseIterable` synthesis for enums with elements that have availability requirements, so I added some. Resolves rdar://144897917.
12 KiB
12 KiB