Skip to content

Commit 540b9c6

Browse files
Incorporate changes from PR feedback
1 parent 53c7bfc commit 540b9c6

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

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

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Author: [James Dempsey](https://github.com/dempseyatgithub)
55
* Review Manager: [John McCall](https://github.com/rjmccall)
66
* Status: **Accepted**
7-
* Implementation: [apple/swift-package-manager#7620](https://github.com/apple/swift-package-manager/pull/7620)
7+
* Implementation: [swiftlang/swift-package-manager#7620](https://github.com/swiftlang/swift-package-manager/pull/7620), [swiftlang/swift#75564](https://github.com/swiftlang/swift/pull/75564)
88
* Review: ([first pitch](https://forums.swift.org/t/pitch-formalize-swift-language-mode-naming-in-tools-and-api/71733)) ([second pitch](https://forums.swift.org/t/pitch-2-formalize-language-mode-naming-in-tools-and-api/72136)) ([review](https://forums.swift.org/t/se-0441-formalize-language-mode-terminology/73182)) ([acceptance](https://forums.swift.org/t/accepted-se-0441-formalize-language-mode-terminology/73716))
99

1010
## Introduction
@@ -49,7 +49,7 @@ Add a new `init` method to `Package` with the following changes from the current
4949
- The parameter `swiftLanguageVersions` is renamed to `swiftLanguageModes`
5050
- The parameter type is now an optional array of `SwiftLanguageMode` values instead of `SwiftVersion` values
5151

52-
The existing init method will be marked as `deprecated` and `renamed` allowing the compiler to provide a fix-it. It will also have the @_disfavoredOverload attribute added to allow the compiler to disambiguate.
52+
The existing init method will be marked as `deprecated` and `renamed` allowing the compiler to provide a fix-it.
5353

5454
#### 2. Rename `swiftLanguageVersions` property to `swiftLanguageModes`
5555
Rename the public `Package` property `swiftLanguageVersions` to `swiftLanguageModes`. Add a `swiftLanguageVersions` computed property that accesses `swiftLanguageModes` for backwards compatibility.
@@ -123,7 +123,7 @@ Package(
123123
```
124124

125125

126-
The existing init method will be marked as `deprecated` and `renamed`, allowing the compiler to provide a fix-it. It will also be annotated with `@_disfavoredOverload` to disambiguate the new and existing init methods:
126+
The existing init method will be marked as `deprecated` and `renamed`, allowing the compiler to provide a fix-it:
127127

128128
```
129129
@_disfavoredOverload
@@ -140,19 +140,6 @@ cxxLanguageStandard:)")
140140
) {
141141
```
142142
143-
#### Deprecating the existing init method by making it a disfavored overload
144-
In order to deprecate the existing method instead of marking it obsoleted, the existing method needs to be annotated with the `@_disfavoredOverlaod` attribute. This is because the two methods are ambiguous when the default value for `swiftLanguageVersions` / `swiftLanguageModes` is used:
145-
146-
```
147-
Package ( // Error: Ambiguous use of 'init'
148-
name: "MyPackage",
149-
products: ...,
150-
targets: ...
151-
)
152-
```
153-
154-
Adding the `@_disfavoredOverlaod` attribute allows the compiler to disambiguate between the two methods.
155-
156143
See the **Source compatibility** section for more details about this change.
157144
158145
### Rename `swiftLanguageVersions` property to `swiftLanguageModes`

0 commit comments

Comments
 (0)