Skip to content

Commit 0f4c1bd

Browse files
Add deprecation of SwiftVersion typealias
- Improve source compatibility section
1 parent 27258ad commit 0f4c1bd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

proposals/nnnn-formalize-language-mode-terminology.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The `-swift-version` option will continue to work as it currently does, preservi
9999

100100
The `-language-mode` option will be presented in the compiler help.
101101

102-
The `-swift-version` option will likely be suppressed from the top-level help of the compiler. More investigation is needed on the details of this.
102+
The `-swift-version` option will be suppressed from the top-level help of the compiler.
103103

104104
### Swift Package Manager
105105
Proposed Swift Package Manager API changes are limited to manifests \>= 6.0:
@@ -174,7 +174,7 @@ For 6.0 and later, that access will be a warning with a fix-it to use the new pr
174174
See the **Source compatibility** section for more details about this change.
175175
176176
### Rename `SwiftVersion` enum to `SwiftLanguageMode`
177-
Rename the existing `SwiftVersion` enum to `SwiftLanguageMode` with `SwiftVersion` added back as a type alias for backwards compatibility.
177+
Rename the existing `SwiftVersion` enum to `SwiftLanguageMode` with `SwiftVersion` added back as a type alias for backwards compatibility. The type alias will be deprecated in 6.0 with a `renamed` annotation to `SwiftLanguageMode`.
178178
179179
This change will not affect serialization of PackageDescription types. Serialization is handled by converting PackageDescription types into separate, corresponding Codable types. The existing serialization types will remain as-is.
180180
@@ -193,7 +193,7 @@ public struct SwiftSetting {
193193
)
194194
```
195195
196-
The name of the function is `swiftLanguageMode()` instead of `languageMode()` to keep naming consistent with the `swiftLanguageModes` parameter of the Package init method. The parameter label `mode` is used to follow the precedent set by `interoperabilityMode()` in `SwiftSetting`.
196+
The name of the function is `swiftLanguageMode()` instead of `languageMode()` to keep naming consistent with the `swiftLanguageModes` parameter of the Package init method. The parameter label `mode` is used to follow the precedent set by the existing `interoperabilityMode()` method in `SwiftSetting`.
197197
198198
Deprecate the `swiftLanguageVersion()` setting added by SE-0435 with a `renamed` annotation to provide a fix-it for developers who have adopted this API in pre-release versions of Swift 6.0.:
199199
@@ -220,7 +220,11 @@ Because the obsoleted `init` method is annotated as `renamed` the compiler will
220220
221221
Renaming the public `swiftLanguageVersions` property of `Package` preserves backwards compatibility by introducing a computed property with that name. The computed property will be marked as `deprecated` in 6.0 and annotated as `renamed` to provide a fix-it.
222222
223-
Searching manifest files in public repositories suggests that accessing the `swiftLanguageVersions` property directly is not common. Making both breaking changes at once results in applying at most two fix-its to a manifest file instead of one.
223+
Searching manifest files in public repositories suggests that accessing the `swiftLanguageVersions` property directly is not common.
224+
225+
The `SwiftVersion` type alias will be deprecated in favor of the `SwiftLanguageMode` enum. This also will provide a fix-it.
226+
227+
Finally the `swiftLanguageVersion()` method in `SwiftSetting` added as part of SE-0435 will be deprecated in favor of the `swiftLanguageMode()` method with a fix-it.
224228
225229
## ABI compatibility
226230
This proposal has no effect on ABI stability.

0 commit comments

Comments
 (0)