Commit Graph

906 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
Philippe Hausler
ae9f5e3cde [Foundation] handle ambiguity in swift 4 mode for Data.init with byte sequences 2018-08-01 09:43:55 -07:00
Morten Bek Ditlevsen
d163245a8b Merge branch 'master' into jsoncodingkeys 2018-07-28 16:44:42 +02: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
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
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
Morten Bek Ditlevsen
a08cd5254f Added another marker protocol for encodable string keyed dictionaries 2018-05-05 22:36:30 +02:00
Morten Bek Ditlevsen
66d9fb3550 Ensure that keys are strings 2018-05-05 22:29:07 +02:00
Morten Bek Ditlevsen
39f9e8f79a Implemented fixes suggested by Itai 2018-05-05 22:21:27 +02:00
Morten Bek Ditlevsen
d35038e277 Merge branch 'master' into jsoncodingkeys 2018-05-05 10:23:57 +02:00
Morten Bek Ditlevsen
b94c4c512b Merge branch 'master' of https://github.com/apple/swift 2018-05-05 10:23:28 +02:00
Itai Ferber
6fa55556a3 Fix a cast to an IUO which can actually be nil. 2018-05-04 14:57:41 -07:00
Jordan Rose
fc99de452d Foundation: resolve some warnings (#16078)
- JSONEncoder.swift: tell the compiler that yes, this is supposed to
  be casting to 'T' and not 'T?'.

- NSObject.swift: mark NSKeyValueObservation members explicitly @objc
  and @nonobjc.

- NSStringAPI.swift: remove unnecessary @usableFromInline.

No intended functionality change.
2018-05-01 15:41:21 -07:00
Itai Ferber
ae8718f083 Merge pull request #16182 from itaiferber/recoverableerror-escaping-resulthandler
RecoverableError's resultHandler needs @escaping
2018-04-30 10:54:00 -07:00
Mox Soini
d4511da4f8 Make _fastEnumerationStorageMutationsPtr internal
...and make Foundation use it's own fileprivate _fastEnumerationStorageMutationsPtr
2018-04-27 00:00:26 +03:00
Itai Ferber
c87bf17efe Mark resultHandler as @escaping 2018-04-26 10:55:40 -07:00
Morten Bek Ditlevsen
c0166bfb31 Remove unused function 2018-04-25 22:47:05 +02:00
Morten Bek Ditlevsen
8a3bc0b73b Make JSONEncoder and JSONDecoder circumvent keyEncodingStrategies and keyDecodingStrategies for String keyed Dictionaries. 2018-04-25 22:40:31 +02:00
Slava Pestov
28ce9204fe stdlib: More SE-0193 updates 2018-04-24 21:21:22 -07:00
Morten Bek Ditlevsen
a5a68ca25d Fix negation of 0 length Decimal (#15986)
A Decimal value with _length 0 and _isNegative set to 1 is interpreted as a NaN. The 'negate()' function however, flipped the _isNegative flag without regard for the _length 0 case. This meant that -0 would become NaN. The fix checks for the _length 0 special case. In NSDecimalSubtract() the same check was performed. Since this now happens in negate(), it is removed from the NSDecimalSubtract() function.
2018-04-18 10:18:34 -07:00