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
/// SR-770 - Currying and `noescape`/`rethrows` don't work together anymore
271
-
func curriedFlatMap<A, B>(_ x:[A])->(@noescape(A)->[B])->[B]{ // expected-warning{{@noescape is the default and is deprecated}} {{41-50=}}
271
+
func curriedFlatMap<A, B>(_ x:[A])->(@noescape(A)->[B])->[B]{ // expected-error{{@noescape is the default and has been removed}} {{41-50=}}
272
272
return{ f in
273
273
x.flatMap(f)
274
274
}
275
275
}
276
276
277
-
func curriedFlatMap2<A, B>(_ x:[A])->(@noescape(A)->[B])->[B]{ // expected-warning{{@noescape is the default and is deprecated}} {{42-51=}}
278
-
return{(f :@noescape(A)->[B])in // expected-warning{{@noescape is the default and is deprecated}} {{17-27=}}
277
+
func curriedFlatMap2<A, B>(_ x:[A])->(@noescape(A)->[B])->[B]{ // expected-error{{@noescape is the default and has been removed}} {{42-51=}}
278
+
return{(f :@noescape(A)->[B])in // expected-error{{@noescape is the default and has been removed}} {{17-27=}}
279
279
x.flatMap(f)
280
280
}
281
281
}
282
282
283
283
func bad(_ a :@escaping(Int)->Int)->Int{return42}
284
-
func escapeNoEscapeResult(_ x:[Int])->(@noescape(Int)->Int)->Int{ // expected-warning{{@noescape is the default and is deprecated}} {{43-52=}}
284
+
func escapeNoEscapeResult(_ x:[Int])->(@noescape(Int)->Int)->Int{ // expected-error{{@noescape is the default and has been removed}} {{43-52=}}
285
285
return{ f in // expected-note{{parameter 'f' is implicitly non-escaping}}
286
286
bad(f) // expected-error {{passing non-escaping parameter 'f' to function expecting an @escaping closure}}
287
287
}
@@ -292,7 +292,7 @@ func escapeNoEscapeResult(_ x: [Int]) -> (@noescape (Int) -> Int) -> Int { // ex
292
292
//
293
293
294
294
// Old syntax -- @noescape is the default, and is redundant
295
-
typealiasCompletionHandlerNE=@noescape(_ success:Bool)->() // expected-warning{{@noescape is the default and is deprecated}} {{33-43=}}
295
+
typealiasCompletionHandlerNE=@noescape(_ success:Bool)->() // expected-error{{@noescape is the default and has been removed}} {{33-43=}}
296
296
297
297
// Explicit @escaping is not allowed here
298
298
typealiasCompletionHandlerE=@escaping(_ success:Bool)->() // expected-error{{@escaping attribute may only be used in function parameter position}} {{32-42=}}
// expected-warning@-1{{@noescape is the default and is deprecated}} {{23-33=}}
330
-
// expected-warning@-2{{@noescape is the default and is deprecated}} {{46-56=}}
331
-
// expected-warning@-3{{@noescape is the default and is deprecated}} {{57-66=}}
329
+
// expected-error@-1{{@noescape is the default and has been removed}} {{23-33=}}
330
+
// expected-error@-2{{@noescape is the default and has been removed}} {{46-56=}}
331
+
// expected-error@-3{{@noescape is the default and has been removed}} {{57-66=}}
332
332
returng(f)
333
-
// expected-warning@-1{{passing a non-escaping function parameter 'f' to a call to a non-escaping function parameter}}
333
+
// expected-error@-1{{passing a non-escaping function parameter 'f' to a call to a non-escaping function parameter}}
334
334
}
335
335
336
336
// <rdar://problem/19997577> @noescape cannot be applied to locals, leading to duplication of code
@@ -339,8 +339,8 @@ enum r19997577Type {
339
339
case Function(()->r19997577Type,()->r19997577Type)
340
340
case Sum(()->r19997577Type,()->r19997577Type)
341
341
342
-
func reduce<Result>(_ initial:Result, _ combine:@noescape(Result,r19997577Type)->Result)->Result{ // expected-warning{{@noescape is the default and is deprecated}} {{53-63=}}
343
-
letbinary:@noescape(r19997577Type,r19997577Type)->Result={combine(combine(combine(initial,self), $0), $1)} // expected-warning{{@noescape is the default and is deprecated}} {{17-27=}}
342
+
func reduce<Result>(_ initial:Result, _ combine:@noescape(Result,r19997577Type)->Result)->Result{ // expected-error{{@noescape is the default and has been removed}} {{53-63=}}
343
+
letbinary:@noescape(r19997577Type,r19997577Type)->Result={combine(combine(combine(initial,self), $0), $1)} // expected-error{{@noescape is the default and has been removed}} {{17-27=}}
344
344
switchself{
345
345
case.Unit:
346
346
returncombine(initial,self)
@@ -354,15 +354,15 @@ enum r19997577Type {
354
354
355
355
// type attribute and decl attribute
356
356
func noescapeD(@noescape f:@escaping()->Bool){} // expected-error {{attribute can only be applied to types, not declarations}}
357
-
func noescapeT(f:@noescape()->Bool){} // expected-warning{{@noescape is the default and is deprecated}} {{19-29=}}
357
+
func noescapeT(f:@noescape()->Bool){} // expected-error{{@noescape is the default and has been removed}} {{19-29=}}
358
358
func noescapeG<T>(@noescape f:()->T){} // expected-error{{attribute can only be applied to types, not declarations}}
359
359
360
360
func autoclosureD(@autoclosure f:()->Bool){} // expected-error {{attribute can only be applied to types, not declarations}}
361
361
func autoclosureT(f:@autoclosure()->Bool){} // ok
362
362
func autoclosureG<T>(@autoclosure f:()->T){} // expected-error{{attribute can only be applied to types, not declarations}}
363
363
364
364
func noescapeD_noescapeT(@noescape f:@noescape()->Bool){} // expected-error {{attribute can only be applied to types, not declarations}}
365
-
// expected-warning@-1{{@noescape is the default and is deprecated}} {{39-49=}}
365
+
// expected-error@-1{{@noescape is the default and has been removed}} {{39-49=}}
366
366
367
367
func autoclosureD_noescapeT(@autoclosure f:@noescape()->Bool){} // expected-error {{attribute can only be applied to types, not declarations}}
368
-
// expected-warning@-1{{@noescape is the default and is deprecated}} {{45-55=}}
368
+
// expected-error@-1{{@noescape is the default and has been removed}} {{45-55=}}
0 commit comments