Commit Graph

3606 Commits

Author SHA1 Message Date
Max Moiseev
d4359b83c7 Merge pull request #12819 from moiseev/filtermap
[stdlib] Introduce compactMap and deprecate one flatMap variant
2017-12-19 17:06:32 -08:00
swift-ci
4be14da2c0 Merge pull request #13542 from moiseev/flatten-tests 2017-12-19 16:53:15 -08:00
swift-ci
ed1db5f73f Merge pull request #13540 from DougGregor/infer-from-concrete-sr-6640 2017-12-19 15:36:42 -08:00
Max Moiseev
f5e93f63e9 [tests] Add conformance tests for FlattenSequence/FlattenCollection 2017-12-19 14:58:25 -08:00
swift-ci
4ffbd12635 Merge pull request #13355 from xwu/lilliput-and-blefuscu 2017-12-19 14:52:32 -08:00
Doug Gregor
a55adb2622 [Standard library] Remove extraneous associated type defaults.
These are no longer required by associated type inference.
2017-12-19 13:03:51 -08:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
Doug Gregor
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -08:00
Ben Cohen
9361a6b66f [stdlib] Nest Iterator and Index types for various stdlib types (#13489)
* Nest various top-level Iterator and Index types, and flatten extensions.

* Fix tests from nesting iterator

* Nest Unsafe*BufferPointer.Iterator, extensionify UnsafeBufferPointer

* Degyb LazyCollection

* Nest Flatten iterator and index
2017-12-18 15:27:35 -08:00
Maxim Moiseev
128092a7d6 Rename filterMap to compactMap 2017-12-18 09:22:41 -08:00
Max Moiseev
6f7aecd030 [stdlib] Introduce filterMap and deprecate one flatMap variant
This is the implementation of
[SE-0187](https://github.com/apple/swift-evolution/blob/master/proposals/0187-introduce-filtermap.md)

<rdar://problem/34918180>
2017-12-18 09:16:37 -08:00
Max Moiseev
c27b366f46 [stdlib] Utilize conditional conformances for FlattenCollection (#13476)
* [stdlib] Utilize conditional conformances for FlattenCollection

* Fix indentation [NFC]
2017-12-16 10:57:02 -08:00
Erik Eckstein
5d1827b5ba Remove a wrong assert in the specializer.
In case of partial specialization, the replacement type of a substitution can be generic.
I couldn't find a small unit test for this bug fix. But it is tested by compiling the stdlib with the change in Collection.swift.

rdar://problem/36033852
2017-12-14 15:28:07 -08:00
swift-ci
9633c91146 Merge pull request #13082 from glessard/patch-1 2017-12-12 10:14:53 -08:00
Max Moiseev
fd4e8667ed Implement a custom distance(from:to:) for LazyFilterCollection 2017-12-11 11:31:37 -08:00
Max Moiseev
25a28bc048 Enforce forward collection preconditions in LazyFilterCollection
(cherry picked from commit 229dcd6275)
2017-12-11 10:46:55 -08:00
Max Moiseev
f2f103d56d Rearrange code in LazyFilterCollection and provide delegating overrides
(cherry picked from commit 1388064e37)
2017-12-11 10:46:50 -08:00
Max Moiseev
1c75bd2433 Conditional conformances for LazyCollection
(cherry picked from commit 6e7b36a66c)
2017-12-11 10:46:40 -08:00
Max Moiseev
9e73d092ea Fix tests
(cherry picked from commit a1b1778c53)
2017-12-11 10:46:35 -08:00
Max Moiseev
1f78f3927b [stdlib] Conditional conformances for LazyMapCollection
(cherry picked from commit b927254564)
2017-12-11 10:46:30 -08:00
Max Moiseev
ea02806f28 [stdlib] Conditional conformances for LazyFilterCollection
(cherry picked from commit 833721a172)
2017-12-11 10:46:25 -08:00
Graydon Hoare
62a6b74ad1 Revert "[stdlib] Conditional conformances for Lazy[Filter|Map]Collection" 2017-12-10 12:48:36 -08:00
Xiaodi Wu
81311bebf8 Match memory layout of DoubleWidth to base integer types 2017-12-10 02:30:40 -06:00
Max Moiseev
e4f94a318f [stdlib] Improve default implementation of Collection.distance(from:to:)
(cherry picked from commit 72948cae9a)
2017-12-08 13:07:07 -08:00
Max Moiseev
229dcd6275 Enforce forward collection preconditions in LazyFilterCollection 2017-12-08 13:07:07 -08:00
Max Moiseev
1388064e37 Rearrange code in LazyFilterCollection and provide delegating overrides 2017-12-08 13:04:28 -08:00
Max Moiseev
6e7b36a66c Conditional conformances for LazyCollection 2017-12-08 12:53:24 -08:00
Max Moiseev
a1b1778c53 Fix tests 2017-12-08 12:53:24 -08:00
Max Moiseev
b927254564 [stdlib] Conditional conformances for LazyMapCollection 2017-12-08 12:52:12 -08:00
Max Moiseev
833721a172 [stdlib] Conditional conformances for LazyFilterCollection 2017-12-08 12:52:12 -08:00
Ben Cohen
4ddac3fbbd [stdlib] Eradicate IndexDistance associated type (#12641)
* Eradicate IndexDistance associated type, replacing with Int everywhere

* Consistently use Int for ExistentialCollection’s IndexDistance type.

* Fix test for IndexDistance removal

* Remove a handful of no-longer-needed explicit types

* Add compatibility shims for non-Int index distances

* Test compatibility shim

* Move IndexDistance typealias into the Collection protocol
2017-12-08 12:00:23 -08:00
Max Moiseev
3bace08f9a Revert "[stdlib] Improve default implementation of Collection.distance(from:to:)"
This reverts commit 72948cae9a.
2017-12-07 14:28:19 -08:00
Max Moiseev
72948cae9a [stdlib] Improve default implementation of Collection.distance(from:to:) 2017-12-06 18:19:34 -08:00
Max Moiseev
80940efa6d Merge pull request #13191 from moiseev/ungybbed
[stdlib] Conditional gardening [NFC]
2017-12-06 09:47:46 -08:00
Ben Cohen
85d190cd7d [stdlib] Replace various uses of BlahSlice with Slice to reduce warnings (#13263)
* Kill the slice variants from the gybbed collection test types

* Handful more SDK instances

* Fix SequencesCollections.swift.gyb
2017-12-05 19:09:56 -08:00
Max Moiseev
42eb45347b [stdlib] Conditional gardening 2017-12-05 16:33:48 -08:00
Max Moiseev
8dbaa2a752 Revert "[stdlib] Temporarily exclude DoubleWidth from the standard library" 2017-12-05 15:37:07 -08:00
Karoy Lorentey
9fef06e59c Merge pull request #12752 from hamishknight/dictionary-subscript-addressor
[stdlib] Use addressor for Dictionary's subscript(_:default:)
2017-12-04 15:04:29 +01:00
Ben Cohen
fde0d928eb Add conditional Lazy conformance to Slice when Base is Lazy (#13242) 2017-12-03 21:50:42 -08:00
Hamish
7876391f47 [stdlib] Call nativePointerToValue(at:) from nativePointerToValue(forKey:insertingDefault:) 2017-12-03 17:28:45 +00:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
Greg Parker
415b36dddc [runtime] Clean up symbol exports in casting and class introspection. (#13005) 2017-12-01 17:48:48 -08:00
swift-ci
a5d9ace6bf Merge pull request #13200 from airspeedswift/extensionify 2017-12-01 17:40:58 -08:00
Max Moiseev
156e6eb848 Exclude DoubleWidth due to the binary size concerns
<rdar://problem/32726173>
2017-12-01 14:29:53 -08:00
Max Moiseev
67e5cd0ff3 Merge pull request #13196 from apple/moiseev-patch-1
Remove the GYB artifact [NFC]
2017-12-01 14:25:37 -08:00
ben-cohen
d67c5f0025 Part the fourth 2017-12-01 14:06:14 -08:00
ben-cohen
e7b668e705 Part the third 2017-12-01 12:40:19 -08:00
Ben Cohen
b31cb302fe Part the second 2017-12-01 11:49:10 -08:00
ben-cohen
6d22ded529 Part the first 2017-11-30 20:11:18 -08:00
Nate Cook
45c4c47393 [stdlib] Make DoubleWidth conform to Unsigned/SignedInteger 2017-11-30 21:58:26 -06:00