mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When the CustomAvailability experimental feature is enabled, make it an error to specify an unrecognized availability domain name. Also, add these diagnostics to a diagnostic group so that developers can control their behavior when they are warnings. Resolves rdar://152741624.
19 lines
765 B
Markdown
19 lines
765 B
Markdown
# Unrecognized availability platforms (AvailabilityUnrecognizedName)
|
|
|
|
Warnings that identify unrecognized platform names in `@available` attributes and `if #available` statements.
|
|
|
|
## Overview
|
|
|
|
The `AvailabilityUnrecognizedName` group covers warnings emitted when the platform name specified in an availability related construct is unrecognized by the compiler:
|
|
|
|
```
|
|
@available(NotAValidPlatform, introduced: 1.0) // warning: unrecognized platform name 'NotAValidPlatform'
|
|
public func function() {
|
|
if #available(NotAValidPlatform 2.0, *) { // warning: unrecognized platform name 'NotAValidPlatform'
|
|
// ...
|
|
}
|
|
}
|
|
```
|
|
|
|
Availability specifications with unrecognized platform names in `@available` attributes and `#available` queries are ignored by the compiler.
|