You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,7 +49,7 @@ Add a new `init` method to `Package` with the following changes from the current
49
49
- The parameter `swiftLanguageVersions` is renamed to `swiftLanguageModes`
50
50
- The parameter type is now an optional array of `SwiftLanguageMode` values instead of `SwiftVersion` values
51
51
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.
53
53
54
54
#### 2. Rename `swiftLanguageVersions` property to `swiftLanguageModes`
55
55
Rename the public `Package` property `swiftLanguageVersions` to `swiftLanguageModes`. Add a `swiftLanguageVersions` computed property that accesses `swiftLanguageModes` for backwards compatibility.
@@ -123,7 +123,7 @@ Package(
123
123
```
124
124
125
125
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:
127
127
128
128
```
129
129
@_disfavoredOverload
@@ -140,19 +140,6 @@ cxxLanguageStandard:)")
140
140
) {
141
141
```
142
142
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
-
156
143
See the **Source compatibility** section for more details about this change.
157
144
158
145
### Rename `swiftLanguageVersions` property to `swiftLanguageModes`
0 commit comments