Commit Graph

21502 Commits

Author SHA1 Message Date
Dmitri Hrybenko
f0621d1563 stdlib/Dictionary: eliminate invalid reinterpret casts
rdar://17509909


Swift SVN r19727
2014-07-09 16:03:46 +00:00
Dmitri Hrybenko
435a8ddf0c stdlib/Dictionary: copy the NSDictionary before wrapping it, so that
NSMutableDictionary and other mutable NSDictionary subclasses don't break
Dictionary's value semantics

rdar://17442261


Swift SVN r19726
2014-07-09 15:13:17 +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 Hanson
73d268f0a9 XCTest: Use the new convention for format strings
When asking XCTest to generate format strings for assertions, pass the
requested index + 100 to ask XCTest to generate a string without space
for the expressions themselves, and don't bother passing them either
(since the overlay isn't actually generating stringified expressons).

Addresses <rdar://problem/17597526>.

Swift SVN r19712
2014-07-08 23:27:34 +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
0d6df5f78d Remove Bool <-> ObjCBool conversions.
There's a regression here because we can no longer use "true" or
"false" with ObjCBool. We'll get that back when true and false become
literals.


Swift SVN r19694
2014-07-08 20:17:35 +00:00
Doug Gregor
e6a71b8363 Remove the implicit CFString -> String conversion
Swift SVN r19693
2014-07-08 20:07:49 +00:00
Doug Gregor
ed54826e1c Replace the implicit NSRange -> Range<Int> conversion with a toRange method
Swift SVN r19692
2014-07-08 20:05:09 +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
Doug Gregor
9e2b68c4f9 Introduce CGFloat as a distinct struct type.
CGFloat is 32-bit on 32-bit architectures and 64-bit on 64-bit
architectures for historical reasons. Rather than having it alias
either Float (32-bit) or Double (64-bit), introduce a distinct struct
type for CGFloat. CGFloat provides a complete set of comparisons and
arithmetic operators (including tgmath functions), initializers allows
explicit conversion between it an Int, UInt, Float, and Double, as
well as conforming to all of the protocols that Float/Double do.

This formulation of CGFloat makes use of CGFloat
architecture-independent, although it still requires a number of casts.
Fixes <rdar://problem/17224725>

Swift SVN r19689
2014-07-08 19:00:18 +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
Jordan Rose
2826391407 [CMake] Fix SpriteKit single-platform build.
Swift SVN r19667
2014-07-08 01:14:15 +00:00
Jordan Rose
bd80c74acd [CMake] XCTest is not ready to be a TARGET_LIBRARY.
Sorry for the churn!

Swift SVN r19666
2014-07-08 01:06:16 +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
Jordan Rose
22f2cde7f6 [CMake] Mark SpriteKit and XCTest as TARGET_LIBRARY targets.
(i.e. that they should be built for iOS using Doug's new schema.)

Swift SVN r19661
2014-07-08 00:59:07 +00:00
Enrico Granata
15b42fdfcd Move the Foundation-specific Mirrors in their own file. These are not as obviously boilerplate as other ones, so there is less to be saved, but Foundation.swift is an over-crowded file anyway
Swift SVN r19659
2014-07-08 00:56:55 +00:00
Enrico Granata
4fd20e7064 Use The Mirror Generator to simplify the CoreGraphics mirrors - a little bit of magic, but much less boilerplate
Oh, and add a test case for those Mirrors, since none was there



Swift SVN r19653
2014-07-08 00:17:06 +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
Enrico Granata
d77f7b948c Unbreak the iOS build by only compiling the SpriteKit mirrors on OSX
Swift SVN r19650
2014-07-07 23:35:32 +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
9a9d3649aa Refactor SpriteKit mirrors to use The Mirror Generator
These were especially painful to look at, since they were identical and could not be unified due to an IRGen bug



Swift SVN r19638
2014-07-07 21:39:12 +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
Joe Groff
8b61c71f07 Overlay NSApplicationMain to fix its argv type.
<rdar://problem/17577380>

Swift SVN r19625
2014-07-07 19:03:48 +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
Doug Gregor
0c31ff5681 Move bridging conversions into the type checker.
Previously, bridged value types and their corresponding Objective-C
classes allow inter-conversion via a number of user-defined conversion
functions in the Foundation module. Instead, make this a general
feature of the type checker so we can reason about it more
directly. Fixes <rdar://problem/16956098> and
<rdar://problem/17134986>, and eliminates 11 (half) of the
__conversion functions from the standard library and overlays.

A few notes:
  - The XCTest changes are because a String can no longer directly
  conform to CVarArg: this is a Good Thing (TM), because it should be
  ambiguous: did you mean to pass it as an NSString or a C string?
  - The Objective-C representations for the bridged collections are
  hard-coded in the type checker. This is unfortunate and can be
  remedied by adding another associated type to the
  _BridgedToObjectiveC protocol.

Swift SVN r19618
2014-07-07 18:04:18 +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