@@ -165,3 +165,60 @@ func functionWithDeprecatedMethodInDeadElseBranch() {
165
165
let _ = ClassDeprecatedIn10_9 ( ) // no-warning
166
166
}
167
167
}
168
+
169
+ // https://github.com/apple/swift/issues/59843
170
+ class I59843_A {
171
+ @available ( macOS, deprecated: 10.51 , renamed: " configure(with:) " )
172
+ static func configure( a: String , b: String ) { }
173
+
174
+ static func configure( with: Int ) { }
175
+
176
+ @available ( macOS, deprecated: 10.51 , renamed: " method(with:) " )
177
+ func method( a: String , b: String ) { }
178
+
179
+ func method( with: Int ) { }
180
+
181
+ func f( ) {
182
+ self . method ( a: " a " , b: " b " ) // expected-warning{{'method(a:b:)' was deprecated in macOS 10.51: renamed to 'method(with:)'}}
183
+ // expected-note@-1{{use 'method(with:)' instead}} {{none}}
184
+ }
185
+ }
186
+
187
+ class I59843_B {
188
+ @available ( macOS, deprecated: 10.51 , renamed: " configure(with:and:) " )
189
+ static func configure( a: String , b: String ) { }
190
+
191
+ static func configure( with: Int , and: Int ) { }
192
+
193
+ @available ( macOS, deprecated: 10.51 , renamed: " method(with:and:) " )
194
+ func method( a: String , b: String ) { }
195
+
196
+ func method( with: Int , and: Int ) { }
197
+
198
+ // Context
199
+ @available ( macOS, deprecated: 10.51 , renamed: " I59843_B.context(with:and:) " )
200
+ static func context( a: String , b: String ) { }
201
+
202
+ static func context( with: Int , and: Int ) { }
203
+
204
+ @available ( macOS, deprecated: 10.51 , renamed: " I59843_A.contextDiff(with:and:) " )
205
+ static func contextDiff( a: String , b: String ) { }
206
+
207
+ static func contextDiff( with: Int , and: Int ) { }
208
+
209
+ func f( ) {
210
+ self . method ( a: " a " , b: " b " ) // expected-warning{{'method(a:b:)' was deprecated in macOS 10.51: renamed to 'method(with:and:)'}}
211
+ // expected-note@-1{{use 'method(with:and:)' instead}} {{17-18=with}} {{25-26=and}}
212
+ }
213
+ }
214
+
215
+ func I59843_f( ) {
216
+ I59843_A . configure ( a: " a " , b: " b " ) // expected-warning{{'configure(a:b:)' was deprecated in macOS 10.51: renamed to 'configure(with:)'}}
217
+ // expected-note@-1{{use 'configure(with:)' instead}} {{none}}
218
+ I59843_B . configure ( a: " a " , b: " b " ) // expected-warning{{'configure(a:b:)' was deprecated in macOS 10.51: renamed to 'configure(with:and:)'}}
219
+ // expected-note@-1{{use 'configure(with:and:)' instead}} {{22-23=with}} {{30-31=and}}
220
+ I59843_B . context ( a: " a " , b: " b " ) // expected-warning{{'context(a:b:)' was deprecated in macOS 10.51: replaced by 'I59843_B.context(with:and:)'}}
221
+ // expected-note@-1{{use 'I59843_B.context(with:and:)' instead}} {{20-21=with}} {{28-29=and}}
222
+ I59843_B . contextDiff ( a: " a " , b: " b " ) // expected-warning{{'contextDiff(a:b:)' was deprecated in macOS 10.51: replaced by 'I59843_A.contextDiff(with:and:)'}}
223
+ // expected-note@-1{{use 'I59843_A.contextDiff(with:and:)' instead}} {{3-23=I59843_A.contextDiff}} {{24-25=with}} {{32-33=and}}
224
+ }
0 commit comments