Commit Graph

1102 Commits

Author SHA1 Message Date
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
ea1a92b6c1 Update CallKit overlay for id-as-Any. 2016-07-25 06:01:21 -07:00
Joe Groff
00ad6f7478 Update SceneKit overlay for id-as-Any. 2016-07-25 06:01:21 -07:00
Joe Groff
ae2e67c66b Update CoreImage overlay for id-as-Any. 2016-07-25 06:01:21 -07:00
Joe Groff
4a34dd1526 Update CoreData overlay for id-as-Any. 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
swift-ci
a9147c215a Merge pull request #3591 from michael-lehew/master 2016-07-21 00:51:38 -07:00
Doug Gregor
9575215f34 Merge pull request #3635 from mwwa/libdispatch-fixits
[libdispatch-fixits] Address stale or incorrect fixits
2016-07-20 22:24:45 -07:00
Doug Gregor
2d7847d7b7 Merge pull request #3648 from mwwa/libdispatch-data-fixes
[libdispatch] libdispatch data fixes
2016-07-20 22:22:02 -07:00
Matt Wright
56a579763f [libdispatch-data-fixes] Appending UnsafeBufferPointers to data is unsafe
* The buffer-pointer based init methods were passing the dispatch
    data default destructor in such a way that the
    @convention(block)-ness was lost. This leads to a thunk being passed
    to dispatch instead of NULL. Subsequently, dispatch would reference
    rather than copy the provided data.

    Fixes:
	SR-2050 (<rdar://problem/27293973>)
2016-07-20 16:46:31 -07:00
Maxim Moiseev
c2e3369968 Photos overlay (#3613) 2016-07-20 15:01:46 -07:00
Matt Wright
bb40547123 [libdispatch-data-fixes] DispatchDataIterator crashes when iterating DispatchData.empty
*  DispatchDataIterator is unsafe when iterating the empty
    DispatchData object as it forcibly unwraps a nil pointer.
2016-07-20 14:57:39 -07:00
Michael LeHew
64ed60753e Merge branch 'master' of https://github.com/apple/swift 2016-07-20 12:05:53 -07:00
Matt Wright
25f7cda01c [libdispatch-fixits] Address stale or incorrect fixits
* Several fixits references stale or deprecated methods, or
    generated incorrect syntax when applied to actual code.

    Fixes:
	<rdar://problem/26681271>
	<rdar://problem/27088581>
	<rdar://problem/27181502>
2016-07-20 11:21:14 -07:00
Chris Lattner
bc09af33f1 Merge pull request #3592 from practicalswift/trailing-semicolon
[gardening] Remove trailing semicolons.
2016-07-19 22:58:35 -07:00
Michael LeHew
f4f9be562d Merge branch 'master' of https://github.com/apple/swift 2016-07-19 17:06:02 -07:00
Max Moiseev
182e721afc [overlay] Adding CoreMedia dependency to the CoreImage overlay 2016-07-19 15:52:58 -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
swift-ci
d82483bcee Merge pull request #3584 from mwwa/libdispatch-overlay-fixes 2016-07-18 22:16:00 -07:00
lplarson
3c3d1004d5 Merge pull request #3593 from moiseev/fix-xctest-deps
[overlay] A tentative fix for the intermittent build failures.
2016-07-18 18:20:38 -07:00
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Max Moiseev
2facb335bf [overlay] A tentative fix for the intermittent build failures.
It looks from the failed build logs that XCTest has a transitive
dependency on CoreMedia, so listing this dependency explicitly might
solve the problem.
rdar://problem/27404152
2016-07-18 16:14:40 -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
practicalswift
8287c5dfca [gardening] Remove trailing semicolons.
Inspiration: 425138c56e
2016-07-19 00:04:53 +02: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