|
3 | 3 | func flatMapOnSequence<
|
4 | 4 | S : Sequence
|
5 | 5 | >(xs: S, f: (S.Element) -> S.Element?) {
|
6 |
| - _ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{compactMap}} |
| 6 | + _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} |
7 | 7 | }
|
8 | 8 |
|
9 | 9 | func flatMapOnLazySequence<
|
10 | 10 | S : LazySequenceProtocol
|
11 | 11 | >(xs: S, f: (S.Element) -> S.Element?) {
|
12 |
| - _ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{compactMap}} |
| 12 | + _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} |
13 | 13 | }
|
14 | 14 |
|
15 | 15 | func flatMapOnLazyCollection<
|
16 | 16 | C : LazyCollectionProtocol
|
17 | 17 | >(xs: C, f: (C.Element) -> C.Element?) {
|
18 |
| - _ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{compactMap}} |
| 18 | + _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} |
19 | 19 | }
|
20 | 20 |
|
21 | 21 | func flatMapOnLazyBidirectionalCollection<
|
22 | 22 | C : LazyCollectionProtocol & BidirectionalCollection
|
23 | 23 | >(xs: C, f: (C.Element) -> C.Element?)
|
24 | 24 | where C.Elements : BidirectionalCollection {
|
25 |
| - _ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{compactMap}} |
| 25 | + _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} |
26 | 26 | }
|
27 | 27 |
|
28 | 28 | func flatMapOnCollectinoOfStrings<
|
29 | 29 | C : Collection
|
30 | 30 | >(xs: C, f: (C.Element) -> String?) {
|
31 |
| - _ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{compactMap}} |
| 31 | + _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} |
32 | 32 | }
|
0 commit comments