Commit Graph

636 Commits

Author SHA1 Message Date
Tony Parker
19998457d3 Merge pull request #3607 from phausler/UndoManager_registerUndo_naming_update
[Foundation] Update UndoManager registerUndo to adopt new naming rules
2016-07-26 14:15:02 -07:00
Tony Parker
0a8c6ba190 Merge pull request #3766 from mjmdavis/master
Correct Swift Decimal.divide to call NSDecimalDivide.
2016-07-26 14:01:49 -07:00
Joe Groff
1e8dd0e34b ClangImporter: Import unbounded NSSets and NSDictionaries using AnyHashable. 2016-07-26 13:36:05 -07:00
Joe Groff
e884ab737d Foundation: Make AnyHashable bridge to NSObject. 2016-07-26 13:36:05 -07:00
Tony Parker
a0470750bb Merge pull request #3609 from phausler/CharacterSet_naming_changes
[Foundation] Update CharacterSet and NSCharacterSet punctuationCharac…
2016-07-26 09:41:47 -07:00
David Farler
4a57e647e6 Merge pull request #3762 from bitjammer/se-0081-diagnostic-and-crashes
[SE-0081] Warn on deprecated where clause inside angle brackets
2016-07-26 09:09:30 -07:00
Michael Davis
6c03c553aa Correct Swift Decimal.divide to call NSDecimalDivide. 2016-07-26 17:02:11 +02:00
Arnold Schwaighofer
39389b9c09 [SE-0125] Remove isUniquelyReferenced and the NonObjectiveCBase class
We can express the same using the `isUniquelyReferencedNonObjC` API.

- Rename `isUniquelyReferencedNonObjC` to `isKnownUniquelyReferenced`.
- Cleanup `ManagedBufferPointer` by removing holdsUniqueOrPinnedReference` and
  renaming `holdsUniqueReference` to `isUniqueReference`.
- No longer promise to return false from `isKnownUniquelyReferenced` for @objc
  class instances.

SR-1962
rdar://21886410
2016-07-26 07:09:29 -07:00
Dmitri Gribenko
e9f1bccd37 Foundation: add commented out custom AnyHashable representation to Measurement
It is disabled because bridging of Measurement instances does not actually work now.
2016-07-26 03:10:52 -07:00
Dmitri Gribenko
34f6eb1438 Foundation: add custom AnyHashable representations to new value types 2016-07-26 03:10:52 -07:00
Dmitri Gribenko
a3254b7990 Foundation: add custom AnyHashable representations to NSNumber and NSString
We want NSNumbers bridged from Swift types to bridge back to the same
Swift type.
2016-07-26 03:10:52 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
David Farler
7bfaeb57f1 [SE-0081] Warn on deprecated where clause inside angle brackets
and provide a fix-it to move it to the new location as referenced
in SE-0081.

Fix up a few stray places in the standard library that is still using
the old syntax.

Update any ./test files that aren't expecting the new warning/fix-it
in -verify mode.

While investigating what I thought was a new crash due to this new
diagnostic, I discovered two sources of quite a few compiler crashers
related to unterminated generic parameter lists, where the right
angle bracket source location was getting unconditionally set to
the current token, even though it wasn't actually a '>'.
2016-07-26 01:41:10 -07:00
swift-ci
3cfcb55bfc Merge pull request #3752 from parkera/foundation_reflection 2016-07-25 22:29:48 -07:00
Jordan Rose
0712ffcb07 Convert the Dispatch and Foundation overlays to 'fileprivate'. (#3753)
Similar to the work in apple/swift-corelibs-foundation#445.

Groundwork for SE-0025 ('private' and 'fileprivate').
No intended functionality change.
2016-07-25 20:58:06 -07:00
Joe Groff
10a0eb1c13 Merge pull request #3710 from jckarter/turn-on-id-as-any
Turn on id as any
2016-07-25 18:58:27 -07:00
Tony Parker
dab81e8674 Add CustomReflectable implementation to most Foundation value types.
Also improves the basic debugDescription and description methods.

rdar://26580762
2016-07-25 17:05:51 -07:00
swift-ci
2c6ac01d28 Merge pull request #3660 from parkera/url_resource_fixits 2016-07-25 13:39:46 -07:00
Joe Groff
32b50c624d stdlib: Remove _isBridgedToObjectiveC from _ObjectiveCBridgeable.
All generic bridgeable types can bridge for all their instantiations now. Removing this ferrets out some now-unnecessary traps that check for unbridgeable parameter types.
2016-07-25 06:01:21 -07:00
Joe Groff
95e462022d Update Foundation overlay for id-as-Any. 2016-07-25 06:01:21 -07:00
Dmitri Gribenko
d82682ec6c Merge pull request #3733 from practicalswift/typo-fixes-20160724
[gardening] Fix recently introduced typos.
2016-07-24 15:43:03 -07:00
Michael Gottesman
dea6dd1e3b Merge pull request #3729 from practicalswift/a-vs-an-fixes-ii
[gardening] "a" vs. "an"-fixes
2016-07-24 14:18:22 -07:00
practicalswift
7e89679404 [gardening] Fix recently introduced typos. 2016-07-24 22:32:40 +02:00
practicalswift
5c916c0e71 [gardening] "a" vs. "an"-fixes 2016-07-24 21:39:51 +02:00
practicalswift
77b6df5063 [gardening] Normalize character use (use ' and "). 2016-07-24 21:31:02 +02:00
Steve (Numerics) Canon
11baa7a14f Possible fix for label of isTotallyOrdered(below:). 2016-07-22 15:21:21 -04:00
Xin Tong
bbf86865d6 Change unicodescalar to failable
We were using a precondition which crashes the program when invalid input is
provided. We want to provide a way to gracefully check and handle invalid input
or shutdown the program if necessary.

SR-1930
2016-07-21 15:27:13 -07:00
Kevin Perry
2cd5426a2e Use alternate implementation of Data.write() on macOS and iOS versions where the provided implementation would crash
rdar://26278731
2016-07-21 12:07:00 -07:00
Tony Parker
261779243e Add a fix-it for URL.setResourceValues/getResourceValues.
This will help with migration from NSURL to struct URL.

Also, include a bonus unit test for this API.
2016-07-21 10:04:33 -07:00
Michael LeHew
f4f9be562d Merge branch 'master' of https://github.com/apple/swift 2016-07-19 17:06:02 -07:00
Luke Larson
74e0498015 Revert "Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs."
This reverts commit 62d1fa760c.
2016-07-19 15:18:17 -07:00
Mishal Shah
62d1fa760c Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-07-19 22:31:34 +02:00
Joe
a6dad0091b [SE-0095] Initial parsing implementation for '&' composition syntax
This commit defines the ‘Any’ keyword, implements parsing for composing
types with an infix ‘&’, and provides a fixit to convert ‘protocol<>’

- Updated tests & stdlib for new composition syntax
- Provide errors when compositions used in inheritance.
Any is treated as a contextual keyword. The name ‘Any’
is used emit the empty composition type. We have to
stop user declaring top level types spelled ‘Any’ too.
2016-07-19 12:01:02 -07:00
Philippe Hausler
e9cae7be79 [Foundation] Update CharacterSet and NSCharacterSet punctuationCharacters to more consistent naming
Addresses rdar://problem/26628434 Swift3: "whitespaces"?
2016-07-19 11:09:35 -07:00
Philippe Hausler
e8639fe501 [Foundation] Update UndoManager registerUndo to adopt new naming rules
Addresses rdar://problem/26500390 registerUndoWithTarget in overlay not updated for new API names
2016-07-19 11:04:46 -07:00
Dave Abrahams
b5bc9be6fb <label> body => _ body 2016-07-19 07:05:53 -06:00
Doug Gregor
eb27bb65a7 Merge pull request #3602 from DougGregor/se-0091-operators-in-types
Implement SE-0091: Operators in types
2016-07-19 00:14:04 -07:00
Andrew Trick
73106dd7c3 Rename initialize(with:count:) to initialize(to:count:). (#3601)
As proposed in SE-0107: UnsafeRawPointer.

"with" is considered a vacuous preposition. "to" implies direction.
2016-07-18 23:37:45 -07:00
Doug Gregor
ab3a15c87a [SE-0091 / Foundation overlay] Move operators into types.
Foundation provides a number of specific operators defined in the
global scope. Push all of these into their corresponding types. This
cleanup helps verify that the SE-0091 implementation is generally
functional.
2016-07-18 23:18:57 -07:00
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Saleem Abdulrasool
3b378f7313 Merge pull request #3582 from compnerd/nullability-portability
stdlib: use the modern spellings for nullability
2016-07-18 16:13:23 -07:00
Michael LeHew
a37120cb61 Ensure internal ObjC classes aren't exposed in archives.
We currently specify a few internal ObjC classes.  This commit ensures that they can not be accidentally exposed (and thus need to be supported) into the future. Luckily, NSData and NSDictionary/NSMutableDictionary already specify classForCoder in a general way. NSCharacterSet does not.

This commit also establishes unit tests to ensure all three types do not regress from this into the future.

Also, for completeness, it ensures classForArchiver and classForKeyedArchiver return appropriately as well.
2016-07-18 14:51:18 -07:00
Dave Abrahams
22c8515558 <label> body => _ body 2016-07-18 14:29:08 -06:00
Saleem Abdulrasool
e582465b0e stdlib: use the modern spellings for nullability
Use the portable spelling for the nullability keywords (_Nullable, _Nonnullable,
_Null_unspecified) rather than the old spelling (__nullable, __nonnullable,
__null_unspecified).  NFC.
2016-07-18 12:23:41 -07:00
Doug Gregor
425138c56e [Foundation overlay] Remove an unsightly semicolon 2016-07-18 10:01:50 -07:00
swift-ci
8ca108521c Merge pull request #3558 from parkera/calendar_timezone_locale 2016-07-17 20:34:07 -07:00
Tony Parker
7bce0c4912 Fix mistake in tvOS availability 2016-07-17 19:43:07 -07:00
swift-ci
0e15183279 Merge pull request #3495 from rudkx/fix-ordered-compare-of-optional 2016-07-17 19:28:34 -07:00
Mark Lacey
599ab76fb8 Remove ordered compare of optional and non-optional.
Safely unwrap two optionals used in the compare that follows.

NFC, but this (or another work-around) will be required if either
SE-0121 or SE-0123 is approved.
2016-07-17 17:45:36 -07:00