@@ -175,7 +175,7 @@ internal class _AnySequenceBox<Element> {
175175 @inlinable
176176 internal func _map< T> (
177177 _ transform: ( Element ) throws -> T
178- ) throws -> [ T ] {
178+ ) rethrows -> [ T ] {
179179 _abstract ( )
180180 }
181181
@@ -525,8 +525,8 @@ internal final class _SequenceBox<S: Sequence>: _AnySequenceBox<S.Element> {
525525 @inlinable
526526 internal override func _map< T> (
527527 _ transform: ( Element ) throws -> T
528- ) throws -> [ T ] {
529- try _base. map ( transform)
528+ ) rethrows -> [ T ] {
529+ return try _base. map ( transform)
530530 }
531531 @inlinable
532532 internal override func _filter(
@@ -618,8 +618,8 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
618618 @inlinable
619619 internal override func _map< T> (
620620 _ transform: ( Element ) throws -> T
621- ) throws -> [ T ] {
622- try _base. map ( transform)
621+ ) rethrows -> [ T ] {
622+ return try _base. map ( transform)
623623 }
624624 @inlinable
625625 internal override func _filter(
@@ -813,8 +813,8 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
813813 @inlinable
814814 internal override func _map< T> (
815815 _ transform: ( Element ) throws -> T
816- ) throws -> [ T ] {
817- try _base. map ( transform)
816+ ) rethrows -> [ T ] {
817+ return try _base. map ( transform)
818818 }
819819 @inlinable
820820 internal override func _filter(
@@ -1026,8 +1026,8 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
10261026 @inlinable
10271027 internal override func _map< T> (
10281028 _ transform: ( Element ) throws -> T
1029- ) throws -> [ T ] {
1030- try _base. map ( transform)
1029+ ) rethrows -> [ T ] {
1030+ return try _base. map ( transform)
10311031 }
10321032 @inlinable
10331033 internal override func _filter(
@@ -1303,26 +1303,10 @@ extension AnySequence {
13031303 }
13041304
13051305 @inlinable
1306- @_alwaysEmitIntoClient
1307- public func map< T, E> (
1308- _ transform: ( Element ) throws ( E ) -> T
1309- ) throws ( E) -> [ T ] {
1310- do {
1311- return try _box. _map ( transform)
1312- } catch {
1313- throw error as! E
1314- }
1315- }
1316-
1317- // ABI-only entrypoint for the rethrows version of map, which has been
1318- // superseded by the typed-throws version. Expressed as "throws", which is
1319- // ABI-compatible with "rethrows".
1320- @usableFromInline
1321- @_silgen_name ( " $ss11AnySequenceV3mapySayqd__Gqd__xKXEKlF " )
1322- func __rethrows_map< T> (
1306+ public func map< T> (
13231307 _ transform: ( Element ) throws -> T
1324- ) throws -> [ T ] {
1325- try map ( transform)
1308+ ) rethrows -> [ T ] {
1309+ return try _box . _map ( transform)
13261310 }
13271311
13281312 @inlinable
@@ -1406,26 +1390,10 @@ extension AnyCollection {
14061390 }
14071391
14081392 @inlinable
1409- @_alwaysEmitIntoClient
1410- public func map< T, E> (
1411- _ transform: ( Element ) throws ( E ) -> T
1412- ) throws ( E) -> [ T ] {
1413- do {
1414- return try _box. _map ( transform)
1415- } catch {
1416- throw error as! E
1417- }
1418- }
1419-
1420- // ABI-only entrypoint for the rethrows version of map, which has been
1421- // superseded by the typed-throws version. Expressed as "throws", which is
1422- // ABI-compatible with "rethrows".
1423- @usableFromInline
1424- @_silgen_name ( " $ss13AnyCollectionV3mapySayqd__Gqd__xKXEKlF " )
1425- func __rethrows_map< T> (
1393+ public func map< T> (
14261394 _ transform: ( Element ) throws -> T
1427- ) throws -> [ T ] {
1428- try map ( transform)
1395+ ) rethrows -> [ T ] {
1396+ return try _box . _map ( transform)
14291397 }
14301398
14311399 @inlinable
@@ -1515,26 +1483,10 @@ extension AnyBidirectionalCollection {
15151483 }
15161484
15171485 @inlinable
1518- @_alwaysEmitIntoClient
1519- public func map< T, E> (
1520- _ transform: ( Element ) throws ( E ) -> T
1521- ) throws ( E) -> [ T ] {
1522- do {
1523- return try _box. _map ( transform)
1524- } catch {
1525- throw error as! E
1526- }
1527- }
1528-
1529- // ABI-only entrypoint for the rethrows version of map, which has been
1530- // superseded by the typed-throws version. Expressed as "throws", which is
1531- // ABI-compatible with "rethrows".
1532- @usableFromInline
1533- @_silgen_name ( " $ss26AnyBidirectionalCollectionV3mapySayqd__Gqd__xKXEKlF " )
1534- func __rethrows_map< T> (
1486+ public func map< T> (
15351487 _ transform: ( Element ) throws -> T
1536- ) throws -> [ T ] {
1537- try map ( transform)
1488+ ) rethrows -> [ T ] {
1489+ return try _box . _map ( transform)
15381490 }
15391491
15401492 @inlinable
@@ -1626,26 +1578,10 @@ extension AnyRandomAccessCollection {
16261578 }
16271579
16281580 @inlinable
1629- @_alwaysEmitIntoClient
1630- public func map< T, E> (
1631- _ transform: ( Element ) throws ( E ) -> T
1632- ) throws ( E) -> [ T ] {
1633- do {
1634- return try _box. _map ( transform)
1635- } catch {
1636- throw error as! E
1637- }
1638- }
1639-
1640- // ABI-only entrypoint for the rethrows version of map, which has been
1641- // superseded by the typed-throws version. Expressed as "throws", which is
1642- // ABI-compatible with "rethrows".
1643- @usableFromInline
1644- @_silgen_name ( " $ss25AnyRandomAccessCollectionV3mapySayqd__Gqd__xKXEKlF " )
1645- func __rethrows_map< T> (
1581+ public func map< T> (
16461582 _ transform: ( Element ) throws -> T
1647- ) throws -> [ T ] {
1648- try map ( transform)
1583+ ) rethrows -> [ T ] {
1584+ return try _box . _map ( transform)
16491585 }
16501586
16511587 @inlinable
0 commit comments