Commit Graph

21665 Commits

Author SHA1 Message Date
Dave Abrahams
3e3f4a6e52 Revert "infix + and - for RandomAccessIndex"
This commit was premature; we're having trouble with protocols that needs to be
resolved first.

This reverts r19778

Swift SVN r19780
2014-07-10 04:47:12 +00:00
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
c7adb497ba Blocks "are" classes, from the runtime perspective.
This allows arrays of blocks to be bridged at runtime
<rdar://problem/17035548>.

Swift SVN r19765
2014-07-10 00:12:14 +00:00
Jordan Rose
254930a134 Update stdlib for r19751.
Swift SVN r19755
2014-07-09 22:56:25 +00:00
Jordan Rose
44b93b5ebc [XCTest] Fix enumerator names after r19732.
Swift SVN r19736
2014-07-09 19:48:34 +00:00
Enrico Granata
8cfde77fbb Part of logging an NSView is redrawing it if it's dirty
However, a view can ask to be redrawn by setting its needsDisplay flag to true
When this happens in a playground, the
self.needsDisplay = true line
forces the view to be logged - logging the view forces it to be redrawn, and unless there's a way out that does not force-redraw, this ends up being an endless loop & of course at some point we run out of stack, and "random" crashes ensue

Add a set of views currently being logged and add/remove views as needed to ensure we don't try to actively log the same view twice

Since UI drawing can only happen on the main thread, if you try to concurrently log views from different threads, you already have a problem, so this can be treated as a single-threaded problem

Fixes <rdar://problem/17027976>


Swift SVN r19730
2014-07-09 18:23:52 +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
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