Commit Graph

1324 Commits

Author SHA1 Message Date
Dmitri Hrybenko
ea8f2de15a stdlib: use let-else in zip() implementation
Swift SVN r27927
2015-04-29 21:51:47 +00:00
Dmitri Hrybenko
d8c140f228 stdlib/Zip: use more descriptive names for non-API identifiers
Swift SVN r27926
2015-04-29 21:51:44 +00:00
Dmitri Hrybenko
be05690856 Revert "stdlib/Zip: use more descriptive names for non-API identifiers"
This reverts commit r27922.  I didn't update all use sites.

Swift SVN r27924
2015-04-29 21:31:36 +00:00
Dmitri Hrybenko
1551fd01af stdlib/Zip: use more descriptive names for non-API identifiers
Swift SVN r27922
2015-04-29 21:30:02 +00:00
Dmitri Hrybenko
70d728efef stdlib: remove the staged API changes for zip()
API review has reached consensus that zip() reads better as a free
function.

Swift SVN r27921
2015-04-29 21:30:02 +00:00
Ted Kremenek
ea498e9fef Revert "[stdlib] Merge experimental inheritance support for mirrors"
This is breaking the Jenkins build.

Swift SVN r27919
2015-04-29 20:27:36 +00:00
Dave Abrahams
9407cc5ab8 [stdlib] Merge experimental inheritance support for mirrors
Swift SVN r27918
2015-04-29 20:13:49 +00:00
Dmitri Hrybenko
a741b1b191 stdlib: mark Range.isEmpty for removal, it will become redundant soon
Swift SVN r27907
2015-04-29 04:24:13 +00:00
Dmitri Hrybenko
e0affbcbae stdlib: fix coding style
Swift SVN r27906
2015-04-29 04:24:13 +00:00
Dmitri Hrybenko
4d197dc5b2 Revert "stdlib: change sort() and sorted() into methods"
This reverts commits r27885, r27876.  It looks like they broke iOS on
arm64.

Swift SVN r27893
2015-04-28 23:58:50 +00:00
Dmitri Hrybenko
10430823a6 stdlib: transform the FIXME into a proper FIXME
Swift SVN r27885
2015-04-28 22:21:10 +00:00
Dmitri Hrybenko
b05c372c4f stdlib: change sort() and sorted() into methods
Swift SVN r27876
2015-04-28 18:05:37 +00:00
Dmitri Hrybenko
ff6f084b77 tests: remove -disable-access-control from Sort.swift.gyb
Swift SVN r27859
2015-04-28 04:40:59 +00:00
Dmitri Hrybenko
fd14e70e48 stdlib: rename find() to indexOf() per API review
Swift SVN r27849
2015-04-28 00:30:37 +00:00
Dmitri Hrybenko
0ef360228b stdlib: constrain CollectionType.SubSlice to _CollectionDefaultsType
The language has limitations that don't allow us to express the API we
actually want, and we have to resort to underscored protocols again.

<rdar://problem/20715009> Implement recursive protocol constraints

<rdar://problem/20477576> 'where' constraints on associated types in
protocols

Swift SVN r27820
2015-04-27 21:50:19 +00:00
Dmitri Hrybenko
6e68fd7675 stdlib: remove a FIXME that is fixed now
Swift SVN r27816
2015-04-27 19:59:17 +00:00
Dave Abrahams
e2c6c7e90d [stdlib] Fix "#" parameter warnings due to new rules
Swift SVN r27807
2015-04-27 18:15:34 +00:00
Dmitri Hrybenko
3408c00886 stdlib: fix a typo in a trap message
Swift SVN r27796
2015-04-27 01:09:33 +00:00
Dmitri Hrybenko
f6090c1c89 stdlib: make CollectionType._prext_isEmpty dynamically dispatched
This change makes isEmpty faster for Dictionary and Set, when invoked
from generic algorithms.

Swift SVN r27736
2015-04-26 00:08:14 +00:00
Dmitri Hrybenko
80dc495ad0 stdlib: fix coding style in HashedCollections
Swift SVN r27735
2015-04-26 00:08:14 +00:00
Dmitri Hrybenko
44ef30a5af stdlib: fix grammar in an error message
Swift SVN r27734
2015-04-26 00:08:13 +00:00
Dmitri Hrybenko
3a59a446ac stdlib: adjust _NSSetCoreType to match Foundation nullability audit
Swift SVN r27730
2015-04-26 00:08:11 +00:00
Dmitri Hrybenko
ce95ac26cd stdlib: adjust _NSDictionaryCoreType to match Foundation nullability audit
Swift SVN r27729
2015-04-26 00:08:10 +00:00
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +00:00
Dmitri Hrybenko
8a3e78f3a7 Mirrors can be compiled on non-ObjC runtime
Swift SVN r27716
2015-04-25 03:45:01 +00:00
Dmitri Hrybenko
4b067db516 stdlib: fix indentation
Swift SVN r27707
2015-04-24 20:37:40 +00:00
Doug Gregor
5b767efe72 Fix three unintended API changes from the argument label defaults change.
Swift SVN r27705
2015-04-24 20:31:41 +00:00
Doug Gregor
793b3326af Implement the new rules for argument label defaults.
The rule changes are as follows:
  * All functions (introduced with the 'func' keyword) have argument
  labels for arguments beyond the first, by default. Methods are no
  longer special in this regard.
  * The presence of a default argument no longer implies an argument
  label.

The actual changes to the parser and printer are fairly simple; the
rest of the noise is updating the standard library, overlays, tests,
etc.

With the standard library, this change is intended to be API neutral:
I've added/removed #'s and _'s as appropriate to keep the user
interface the same. If we want to separately consider using argument
labels for more free functions now that the defaults in the language
have shifted, we can tackle that separately.

Fixes rdar://problem/17218256.

Swift SVN r27704
2015-04-24 19:03:30 +00:00
Dmitri Hrybenko
65dcd98c59 stdlib: rename _CollectionGeneratorDefaultsType.{Element -> _Element}
Swift SVN r27676
2015-04-24 04:37:14 +00:00
Dmitri Hrybenko
8b2a1b4e1e stdlib: remove _CollectionSliceDefaultsType
The newest type checker improvements fix the underlying issue.

Swift SVN r27670
2015-04-24 02:42:08 +00:00
Devin Coughlin
8c7d3cc0cb Runtime: Change runtime to use lexicographic version comparison for availability
Change the runtime so that version comparisons use a lexicographic rather
than a component-wise comparison.

rdar://problem/20661965

Swift SVN r27669
2015-04-24 02:20:11 +00:00
Dmitri Hrybenko
7afe30ec7d stdlib: make all collections sliceable, first steps
This commit adds a minimally working Slice type and minimal tests.  Even
though it might seem logical how the new protocol requirements are
injected in the CollectionType hierarchy, it is very fragile and
required many attempts to get the typechecker to finally accept it.
Because I want to ensure that the type checker does not regress, I'm
commiting a patch that does not do much yet.

Swift SVN r27665
2015-04-24 01:27:15 +00:00
Chris Willmore
c7c7388cf2 Change do-while to repeat-while.
Change all uses of "do { ... } while <cond>" to use "repeat" instead.
Rename DoWhileStmt to RepeatWhileStmt. Add diagnostic suggesting change
of 'do' to 'repeat' if a condition is found afterwards.

<rdar://problem/20336424> rename do/while loops to repeat/while & introduce "repeat <count> {}" loops

Swift SVN r27650
2015-04-23 22:48:31 +00:00
Dmitri Hrybenko
af38ea1381 stdlib: add MutableCollectionType._prext_partition()
Swift SVN r27643
2015-04-23 20:52:00 +00:00
Chris Lattner
cd74bbd49b convert some as? bindings in if/let patterns to use 'as' patterns, suggested by Joe. NFC.
Swift SVN r27628
2015-04-23 04:35:52 +00:00
Joe Groff
cce80114fc stdlib: Deprecate CFunctionPointer.
rdar://problem/20477688 is tracking making this (and other things) unavailable when Xcode 7 is released.

Swift SVN r27626
2015-04-23 04:24:34 +00:00
Dmitri Hrybenko
8e3bcef97c stdlib: eliminate _CollectionType, thanks to the new witness type solver
Swift SVN r27622
2015-04-23 01:58:46 +00:00
Dmitri Hrybenko
2ce7dee53d stdlib: remove _SequenceType, thanks to the new type witness solver
Swift SVN r27620
2015-04-23 01:37:31 +00:00
Dmitri Hrybenko
005c76ba07 Revert "stdlib: make all collections sliceable, first steps"
This reverts commit r27617.  Too late, it crashes the type checker now.

Swift SVN r27618
2015-04-23 00:56:30 +00:00
Dmitri Hrybenko
0cdf289c9c stdlib: make all collections sliceable, first steps
This commit adds a minimally working Slice type and minimal tests.  Even
though it might seem logical how the new protocol requirements are
injected in the CollectionType hierarchy, it is very fragile and
required many attempts to get the typechecker to finally accept it.
Because I want to ensure that the type checker does not regress, I'm
commiting a patch that does not do much yet.

Swift SVN r27617
2015-04-23 00:26:08 +00:00
Dmitri Hrybenko
730e6afee0 Revert "stdlib: make map() dynamically dispatched"
This reverts commit r27607.  It broke parse_stdlib_* tests.

Swift SVN r27609
2015-04-22 22:30:45 +00:00
Dmitri Hrybenko
21e5a83631 stdlib: make map() dynamically dispatched
This change tries to recover the performance regression in map() that
was caused by moving map() to a protocol extension and degrading the
static type information (when mapping a collection, we only know that it
is a sequence).  Adding map() to the witness table allows us to provide
a specialized implementation for collections, and hopefully recover the
lost performance.

This is a speculative change, I don't have performance numbers.  I will
watch the performance buildbots and if this change does not help, I'll
revert.

Swift SVN r27607
2015-04-22 22:08:16 +00:00
Dmitri Hrybenko
d9848a6c41 stdlib: migrate last() to use a protocol extension
Swift SVN r27602
2015-04-22 20:42:04 +00:00
Dmitri Hrybenko
7a40ec0916 stdlib: simplify code
Swift SVN r27601
2015-04-22 20:42:01 +00:00
Dave Abrahams
d3f52de076 [stdlib] Mirror: handle chaining
Swift SVN r27592
2015-04-22 17:23:58 +00:00
Dmitri Hrybenko
701dfbecd2 stdlib: use let-else in maxElement()
Swift SVN r27571
2015-04-22 07:06:40 +00:00
Dmitri Hrybenko
7bbb0071a3 stdlib: fix a bug in SequenceType.startsWith() introduced in r27567
Swift SVN r27569
2015-04-22 07:06:39 +00:00
Chris Lattner
3ec09eec8e force adopt let/else and the Swift 1.2 if/let extensions in the stdlib a bit, for dogfooding
and cleanup.

I changes cases that had a non-trivial "then" body but a trivial else.  Most of the cases in
the stdlib have a trivial "then" clause, so I didn't change them.




Swift SVN r27567
2015-04-22 06:24:06 +00:00
Dmitri Hrybenko
69c5a0be3b stdlib: add a public init to _HeapBufferStorage so that it can be used
in tests

Swift SVN r27563
2015-04-22 05:24:20 +00:00
Dmitri Hrybenko
e1adeab0ba stdlib: move SequenceType and related APIs to a separate file
Swift SVN r27560
2015-04-22 04:32:42 +00:00