Commit Graph

1309 Commits

Author SHA1 Message Date
Dave Abrahams
64c6d32a99 [stdlib] infix + and - for RandomAccessIndex
A step towards implementing generalized striding

Swift SVN r19778
2014-07-10 04:16:53 +00:00
Greg Parker
bde0d301fc Fix fmod() covers. Add CGFloat to the math.h tests.
<rdar://problem/17275152> Can't call C fmodf() from stdlib


Swift SVN r19777
2014-07-10 03:54:27 +00:00
Dave Abrahams
b56c3a84d3 [stdlib] Drop Sliceable conformance for Range<T>
Sliceable is a totally non-critical protocol and Range slicing wasn't
even being tested.  Along with r19771, fixes <rdar://problem/16363898>

Swift SVN r19775
2014-07-10 02:08:46 +00:00
Dave Abrahams
b84a3377f0 [stdlib] Drop ReverseRange
Swift SVN r19773
2014-07-10 01:20:58 +00:00
Dave Abrahams
e261dda22b [stdlib] Give reverse() the eager/lazy treatments
Swift SVN r19772
2014-07-10 01:20:57 +00:00
Dave Abrahams
58f94698c3 [stdlib] Disallow indexing integer ranges with Int
This horrible hack prevents the user from indexing Range<I>, for all
integer types I, outside of a generic context.  This seems to be the
best we can do to prevent confusion given the current language.

Addresses <rdar://problem/16363898>

Unfortunately, I can't make this work for slicing ranges yet.

Swift SVN r19771
2014-07-10 01:20:57 +00:00
Dave Abrahams
9918145209 [stdlib] Drop RandomAccessRange
It won't be needed in the new Range plan after all

Swift SVN r19770
2014-07-10 01:20:56 +00:00
Doug Gregor
2f3f6acf21 Make "true" and "false" Boolean literal constants for the BooleanLiteralConvertible protocol.
Introduce the new BooleanLiteralConvertible protocol for Boolean
literals. Take "true" and "false" as real keywords (which is most of the
reason for the testsuite churn). Make Bool BooleanLiteralConvertible
and the default Boolean literal type, and ObjCBool
BooleanLiteralConvertible. Fixes <rdar://problem/17405310> and the
recent regression that made ObjCBool not work with true/false.


Swift SVN r19728
2014-07-09 16:57:35 +00:00
Dmitri Hrybenko
f0621d1563 stdlib/Dictionary: eliminate invalid reinterpret casts
rdar://17509909


Swift SVN r19727
2014-07-09 16:03:46 +00:00
Dmitri Hrybenko
19f3875079 stdlib/Array: remove === and !== for array types
Swift SVN r19725
2014-07-09 15:06:32 +00:00
Dmitri Hrybenko
0523fea01b stdlib/Dictionary: rewrite iteration over wrapped NSDictionary not to
rely on NSDictionary.allKeys, it leaves the array of keys on the
autorelease pool.  Not very bad, but it is better if we can avoid it.

rdar://17604820

Swift SVN r19724
2014-07-09 14:49:49 +00:00
Chris Lattner
02999cac51 Reinstate the @ on the @objc attribute. This is largely a revert of r19555 with a few tweaks.
Swift SVN r19706
2014-07-08 21:50:34 +00:00
Andrew Trick
7ed7be9c14 Put cocoa on the slow path of String.subscript.
Swift SVN r19700
2014-07-08 21:43:16 +00:00
Doug Gregor
8fb9a19542 Replace the "string" property of String.UnicodeScalarView with a String initializer.
Swift SVN r19695
2014-07-08 20:25:30 +00:00
Doug Gregor
973caddc24 Replace String.UnicodeScalarView's user conversion to String with a "string" property
Swift SVN r19691
2014-07-08 20:01:50 +00:00
Dmitri Hrybenko
95ac813af3 stdlib/Dictionary: coding style, comments, renamed type generic parameters
Swift SVN r19687
2014-07-08 16:48:11 +00:00
Dmitri Hrybenko
12aaf7543b stdlib: remove 'public' from private functions
Swift SVN r19686
2014-07-08 16:47:10 +00:00
Dmitri Hrybenko
4556f92949 stdlib/Dictionary: comments, coding style, more semantic _sanityChecks
Swift SVN r19684
2014-07-08 14:49:39 +00:00
Dmitri Hrybenko
977d901643 stdlib: hide quickSort and insertionSort
Finishes rdar://17315534


Swift SVN r19682
2014-07-08 10:33:23 +00:00
Dmitri Hrybenko
8fb09ef13a stdlib: update comments and parameter names for startsWith() algorithm to
clearly reflect semantics

rdar://17567069


Swift SVN r19681
2014-07-08 09:54:10 +00:00
Nadav Rotem
bdecfe75a6 Mark the string builder as @readonly to allow us to remove unused strings.
Swift SVN r19679
2014-07-08 04:52:48 +00:00
Nadav Rotem
a227fcab6c Mark the Array and Dictionary builders with the readonly marker to allow removal of dead code.
Swift SVN r19678
2014-07-08 04:18:46 +00:00
Jordan Rose
5427102268 Remove stray @ from 'public' and 'internal' missed in r19672.
Swift SVN r19675
2014-07-08 03:00:42 +00:00
Enrico Granata
93b3d5fe7b Add Mirror conformance for UnicodeScalar. This doesn't need anything special, a _LeafMirror should suffice
Swift SVN r19674
2014-07-08 02:28:45 +00:00
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Enrico Granata
b6ca5f3a77 Add Mirror support for String.Index
The chosen display mode is using the integer UTF16-based position as the thing to display
This is what would also be displayed by default, except it would show up as {{_position 0},{...}}
Now we avoid exposing the internals, and just essentially coalesce the Index with its numeric value



Swift SVN r19670
2014-07-08 02:13:38 +00:00
Enrico Granata
e73b3120c0 EmptyCollection and CollectionOfOne are similar enough that they can be reflected together. I am a little unhappy with having the summary be a string argument instead of inlined, but I couldn't come up with a quick solution to do otherwise, and it didn't seem worth spending a lot of time dwelling upon that
Swift SVN r19668
2014-07-08 01:30:31 +00:00
Enrico Granata
342202d2d5 Generators don't need Mirrors
Swift SVN r19665
2014-07-08 01:01:27 +00:00
Jordan Rose
f0fc440785 One last cleanup for access control.
Swift SVN r19662
2014-07-08 00:59:07 +00:00
Enrico Granata
64bb537f55 Implement Mirrors for the UTF8/16 view on Swift Strings
Swift SVN r19651
2014-07-07 23:36:00 +00:00
Dave Abrahams
953f740949 [stdlib] Trivial comment fixups
Swift SVN r19649
2014-07-07 23:17:49 +00:00
Dave Abrahams
94e04be86d [stdlib] Make RandomAccessIndex Comparable
Swift SVN r19647
2014-07-07 23:01:02 +00:00
Jordan Rose
faa4004b42 [Accessibility] Public types/functions cannot have private generic parameters.
Or rather, they cannot have constraints on their generic parameters that use
private types.

Swift SVN r19644
2014-07-07 22:52:29 +00:00
Enrico Granata
d611059b70 Refactor the UnsafePointers Mirrors to use the all-powerful Mirror Generator
Reduces some boilerplate



Swift SVN r19640
2014-07-07 22:11:32 +00:00
Enrico Granata
36f035e25e Per Dave, generators don't really need to be reflected
Swift SVN r19639
2014-07-07 21:42:07 +00:00
Enrico Granata
86ebdaffc1 The Mirrors Generator II
Feedback from Dave and Dmitri - the Mirrors.gyb file is now split in three parts:
 - Boilerplate, the value, valueType, objectIdentifier and disposition properties
 - Decl, the type declaration proper, with no opening brace
 - Conformance, the extension that provides Reflectable conformance on the original type
 
This is substantially no feature change, but it should make for easier editing, and a generally more readable experience



Swift SVN r19637
2014-07-07 21:27:20 +00:00
Doug Gregor
e9439ff7da Remove implicit conversion from _DictionaryElement.
Swift SVN r19626
2014-07-07 19:51:58 +00:00
Doug Gregor
d8de1a9ef9 Remove two more implicit conversions used only within the standard library.
Swift SVN r19624
2014-07-07 18:57:36 +00:00
Doug Gregor
2bddbc7711 Replace OnHeap<T>'s implicit conversion with a computed property.
No user-visible change.

Swift SVN r19623
2014-07-07 18:57:35 +00:00
Doug Gregor
d62d98de18 Replace an implicit conversion with a computed property (library implementation detail).
Swift SVN r19622
2014-07-07 18:57:35 +00:00
Jordan Rose
2836c474ec [Accessibility] Public enum cases cannot have private payloads.
...because you can't match them properly in switches.

In the future, we could consider allowing private enum cases in a
resilient public enum, which essentially forces the user to consider the
default case.

Swift SVN r19620
2014-07-07 18:39:35 +00:00
Jordan Rose
2ebcd5d831 Hide the representations of DictionaryIndex and DictionaryGenerator.
Enum cases can't be less public than the enum type in 1.0, so add a trivial
layer of indirection to these types so the "enum-ness" is internal while the
type itself remains public.

Swift SVN r19619
2014-07-07 18:39:33 +00:00
Dmitri Hrybenko
b20abdfcbe stdlib: fix grammar in Array comments (they used to say 'a Array')
rdar://17075487


Swift SVN r19612
2014-07-07 15:31:11 +00:00
Dmitri Hrybenko
09bbec7464 stdlib: fix a crash in String.rangeOfString when the result is NSNotFound
rdar://17550857


Swift SVN r19611
2014-07-07 15:25:10 +00:00
Dmitri Hrybenko
a9ee1f88ac stdlib: remove withUnsafePointerToObject
It is completely unused, and I am not even convinced it is safe.  It
assumes that size of ImplicitlyUnwrappedOptional<T> is equal to pointer
size (while this is true for Objective-C pointer types, there was no
precondition that enforced this).

Swift SVN r19604
2014-07-07 10:53:34 +00:00
Dmitri Hrybenko
6f5a2e5d87 stdlib: remove LifetimeManager, it is completely unused,
withUnsafePointer-like functions provide safer idioms

Swift SVN r19603
2014-07-07 10:32:19 +00:00
Dmitri Hrybenko
f61bf5d8ba stdlib: remove withObjectAtPlusZero(), now we have built-in CF bridging
support

Swift SVN r19601
2014-07-07 10:13:44 +00:00
Dmitri Hrybenko
1911aaed9f stdlib: hide isUniquelyReferenced
Swift SVN r19598
2014-07-07 10:01:48 +00:00
Dmitri Hrybenko
62c772ad6a stdlib: hide Objective-C bridging implementation details
Swift SVN r19595
2014-07-07 09:46:07 +00:00
Dmitri Hrybenko
00fe3bcda3 stdlib: hide swift_keepAlive
Swift SVN r19594
2014-07-07 09:46:02 +00:00