Commit Graph

1485 Commits

Author SHA1 Message Date
Itai Ferber
66083f6003 Merge pull request #16238 from mortenbekditlevsen/jsoncodingkeys
[WIP] JSON Coding Keys - string keyed dictionary opt out
2018-08-09 14:25:58 -07:00
Morten Bek Ditlevsen
7076327ef0 Disambiguation between variable and function with same name 2018-08-08 20:32:27 +02:00
Morten Bek Ditlevsen
517bd32e2e Added comment and included reference to bug 2018-08-08 07:55:59 +02:00
Morten Bek Ditlevsen
eae25a336d Suggestion for a workaround for runtime error related to witness tables on i386 2018-08-06 20:44:43 +02:00
Maxim Moiseev
b7661c5991 [overlay] The AssetsLibrary APIs have been deprecated since iOS 9
Addresses: <rdar://problem/39029315>
2018-08-06 13:10:05 +08:00
Philippe Hausler
ae9f5e3cde [Foundation] handle ambiguity in swift 4 mode for Data.init with byte sequences 2018-08-01 09:43:55 -07:00
Mishal Shah
13f5118a92 Update master to build with Xcode 10 beta 5, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs 2018-07-31 13:05:42 -07:00
Morten Bek Ditlevsen
d163245a8b Merge branch 'master' into jsoncodingkeys 2018-07-28 16:44:42 +02:00
Karoy Lorentey
d03786ee1c [ObjectiveC] NSObject: Clarify hashing implementation
NSObject defines its own interface for hashing and equality. Subclasses must implement custom hashing by overriding the hash property, or NSSet and NSDictionary will not work correctly.

Unfortunately, we currently define NSObject.hashValue and NSObject.hash(into:) as overridable, which leads people to accidentally override one of these instead of hash. hashValue is explicitly declared open, while hash(into:) is automatically synthesized as such.

Making hashValue non-open is a potentially source breaking change, but we can at least provide an explicit, non-overridable definition for hash(into:), and update the documentation to explain the contract.
2018-07-26 16:09:54 +01:00
Ben Cohen
345879429b [stdlib] Take several underscored stdlib functions private (#18134)
* Make _sanityCheck internal

* Make _debugPrecondition internal

* Make Optional._unsafelyUnwrappedUnchecked internal.

* Make _precondition internal

* Switch Foundation _sanityChecks to assertions

* Update file check tests

* Remove one more _debugPrecondition

* Update Optimization-with-check tests
2018-07-24 18:26:19 -07:00
Doug Gregor
b70466dc63 [Type Checker] Add a request kind for computing 'ValueDecl::isObjC()'.
Still a WIP
2018-07-18 14:50:39 -07:00
ktopley-apple
f83c17ca7f Merge pull request #18044 from ktopley-apple/ktopley-dispatch-rdar40951342
Add documentation comments.
2018-07-18 13:34:49 -07:00
ktopley-apple
f0edc02f4e Merge pull request #17399 from mwwa/dispatch-source-nullability
dispatch_source_create returns NULL but is marked up as nonnull
2018-07-18 11:01:11 -07:00
Kim Topley
354bc9e00f Add documentation comments.
rdar://problem/40951342
2018-07-18 10:28:51 -07:00
ktopley-apple
ccdcd94120 Merge pull request #17982 from ktopley-apple/ktopley-dispatch-rdar40775762
Change the signature for DispatchData.enumerateBytes() to match that …
2018-07-18 08:03:49 -07:00
Kim Topley
7b0991f0a8 Change the signature for DispatchData.enumerateBytes() to match that of Data.enumerateBytes() for Swift 4.2 and obsolete the old version.
rdar://problem/40775762
2018-07-17 11:00:55 -07:00
Kim Topley
fc08a12a61 Fix warning for uninitialized va_list variable.
rdar://problem/40626177
2018-07-17 08:21:39 -07:00
Matt Wright
1ff4ca0d41 dispatch_source_create returns NULL but is marked up as nonnull
dispatch_source_create is marked up as non-null but can actually return
null in programming error issues. In order to maintain the nullabilty
contract, these issues will now cause the overlay to assert and crash
rather than return a null pointer out of a non-null call.

Resolves: <rdar://problem/39937177>
2018-07-13 10:47:09 -07:00
Ben Cohen
d82eed458e Migrate UnsafeMutableAudioBufferListPointer off _writeBackMutableSlice. (#17824)
The current behavior is the default you get "for free" from
MutableCollection so there's no good reason for accessing the std lib
file directly, and it requires access to std lib internals to do so.
2018-07-12 10:49:36 -07:00
Michael Gottesman
5648ef219d [+0-all-args] Clean up remains of +1 convention from the runtime. 2018-07-06 23:10:12 -07:00
Mishal Shah
95c80cf2ce Merge pull request #17761 from apple/update-master-xcode-10-beta-3
Update master to build with Xcode 10 beta 3, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs
2018-07-05 15:53:29 -07:00
Stephen Canon
86ba697151 Add constraints to FixedWidthInteger.Stride and .Magnitude (#17716)
* Add constraints to FixedWidthInteger.Stride and .Magnitude

Add the constraint that these associatedtypes themselves conform to FixedWidthInteger and to SignedInteger and UnsignedInteger, respectively. These are effectively part of the semantic requirement of the protocol already, because the requirements on .min and .max effectively force FixedWidthInteger to be twos-complement, which requires Magnitude not be Self for signed types. Also, in practice it's generally necessary to have these two constraints in order to effectively use the FixedWidthInteger protocol anyway; witness that by adding them to the protocol, we eliminate them as constraints from a number of extensions.

This also resolves https://bugs.swift.org/browse/SR-8156
2018-07-05 15:04:33 -04:00
Mishal Shah
811b1d0879 Update master to build with Xcode 10 beta 3, OS X 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs 2018-07-05 10:57:03 -07:00
Ben Cohen
59dea67f0f Remove unused NSRange slice variable (#17747) 2018-07-04 14:45:40 -07:00
Tony Parker
8009e87716 Merge pull request #17607 from lutherjm/pr/40440282
URLComponents is missing percentEncodedQueryItems.
2018-06-29 13:06:48 -07:00
Tony Parker
f9ab5c86c3 Merge pull request #17613 from lutherjm/pr/41378853
URL is missing several URLResourceValues
2018-06-29 10:05:11 -07:00
Ben Cohen
a4230ab2ad [stdlib] Update stdlib to 4.0 and reorganize compatibility shims (#17580)
* Update stdlib to 4.0 and move all compatibility shims into a dedicated source file
2018-06-29 06:26:52 -07:00
Jim Luther
4f0d568c3a Fixed indentation in changes. 2018-06-28 18:22:05 -07:00
Jim Luther
6fbb2a4b25 Fixed indentation in changes. Fixed availability in test. 2018-06-28 18:19:23 -07:00
Jim Luther
0801977f21 URL is missing several URLResourceValues 2018-06-28 15:39:36 -07:00
Jim Luther
a7d3efd6f8 URLComponents is missing percentEncodedQueryItems. I added it and modified the URLComponents test code to make sure it works. 2018-06-28 14:10:47 -07:00
Morten Bek Ditlevsen
250090df2a Merge branch 'master' into jsoncodingkeys 2018-06-20 14:01:22 +02:00
Doug Gregor
f232af5535 [Mangling] Allow standard substitutions in protocol mangling.
Protocol name mangling didn’t always go through a path that allowed the use
of standard substitutions. Enable standard substitutions for protocol name
manglings where they make sense.

Removes ~277k from the standard library binary size.
2018-06-19 23:24:38 -07:00
agnosticdev
0d983964f7 network-typos: Added another file to this commit 2018-06-19 06:12:19 -05:00
agnosticdev
adf06f2842 network-typos: Fixed a few typos while reading through the Network SDK 2018-06-19 06:07:58 -05:00
Jordan Rose
a6ae2d7742 Hack: Force UIEdgeInsets.zero to always come from the SDK (#17122)
...instead of relying on the one in the overlay in pre-4.2 versions of
Swift. This caused crashes in deserialization, which (deliberately)
doesn't respect availability.

There are three changes here:

- Remove UIEdgeInsets.zero and UIOffset.zero from the UIKit overlay.
- Always use the 4.2 name for UIEdgeInsetsZero and UIOffsetZero from
  the underlying UIKit framework. (This is the nested name.)
- Ignore the unavailability messages for those two constants in
  pre-4.2 Swift, since we're now relying on them being present.

The latter two, the compiler changes, can go away once UIKit's API
notes no longer specify different pre-4.2 behavior, but meanwhile we
need to keep compatibility with the SDKs released in Xcode 10b1.

https://bugs.swift.org/browse/SR-7879
2018-06-12 13:40:23 -07:00
Philippe Hausler
d6bf8e3180 [Foundation] adjust inline of append and initialization functions (#17027)
* [Foundation] adjust inline of append and initialization functions and use _copyContents(initialzing:) to avoid performance regressions while using generic collection/sequence APIs

* Add the Array<UInt8> specialization back for append to Data
2018-06-11 15:09:41 -07:00
Mishal Shah
3f8ce7d2f9 Update master to build with Xcode 10 beta 1, OS X 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs. 2018-06-04 23:14:19 -07:00
swift-ci
daeaaf8d91 Merge pull request #16010 from phausler/update_data_inlines 2018-05-30 13:12:22 -07:00
swift-ci
9cd43a0663 Merge pull request #10435 from kballard/url_resolvingBookmarkData 2018-05-28 16:46:44 -07:00
Philippe Hausler
fc2c628014 Remove last public inlines 2018-05-25 13:00:02 -07:00
Philippe Hausler
69e46e6af6 Remove additional inlines 2018-05-25 11:27:29 -07:00
Michael Ilseman
614016fecd [String.Index] Simplify and prepare for more resilience.
Simplify String.Index by sinking transcoded offsets into the .utf8
variant. This is in preparation for a more resilient index type
capable of supporting existential string indices.
2018-05-24 14:47:04 -07:00
Philippe Hausler
2b80e0ca42 [Foundation] Migrate Data to a ABI stable variant
This has one known performance regression; appending with a sequence (not an Array, but something like a Repeated<UInt8>) is slower. We aknowlege this regression and plan to offer an update later that has a specialized variation of this API that optimizes to a memset/memset_pattern. This set of changes is limited to specifically targeting ABI stability and inline characteristics of Data and leaves that optimization as a future addition.
2018-05-23 15:00:26 -07:00
Mike Ash
5b991f30b8 [Runtime] Redo the ErrorObject/dlsym interface to use a struct containing all the bridging points. This allows for better static typing and reduces the amount of dynamic symbol lookups.
rdar://problem/39810532
2018-05-21 17:10:46 -04:00
Ben Langmuir
2e6c7ee76d Revert "[Runtime] Look up Error bridging symbols indirectly through special symbols that won't be stripped in static builds." 2018-05-19 10:05:00 -07:00
Mike Ash
3cc86eb836 [Runtime] Look up Error bridging symbols indirectly through special symbols that won't be stripped in static builds.
This fixes a problem where error bridging didn't work in stripped executables using the static versions of the Swift libraries. ErrorObject.mm looks up some symbols with dlsym, but stripping makes it so it can't find those. This change makes a separate set of symbols explicitly made for ErrorObject.mm to look up, and marks them as dynamically referenced so stripping won't remove them. Longer term, we'd like a better solution for looking up these symbols, but this will do for now.

rdar://problem/39810532
2018-05-17 11:43:15 -04:00
Morten Bek Ditlevsen
0bc343f72c Fixes after comments from Itai 2018-05-08 09:15:27 +02:00
Itai Ferber
c7feef6dec Merge pull request #16393 from itaiferber/localizedString-for-nullability-fix
Correct cast from IUO in Locale.localizedString(for:)
2018-05-07 09:11:59 -07:00
Morten Bek Ditlevsen
13c781fa9c Imitate container stack logic from box_(_ value: Encodable) in box(_ dict: [String : Encodable]) 2018-05-07 10:42:36 +02:00