Commit Graph

3606 Commits

Author SHA1 Message Date
Max Moiseev
d9e0eef4aa Add an @available initializer for source compatibility 2017-07-12 15:12:39 -07:00
Joe Groff
34ec20c0e4 KeyPaths: Ensure mutation accesses are ended in the correct order.
Using an Array to hold onto all the cleanup objects for an access happens to destroy the cleanup objects in FIFO order (and it's probably not a good idea to rely on Array cleaning itself up in any particular order at all). For want of proper accessor coroutines, chain the cleanup objects in a linked list so that they reliably get destroyed in the desired inside-out order. Fixes SR-5442 | rdar://problem/33267959.
2017-07-12 14:41:34 -07:00
Max Moiseev
391d49a31e [overlay] Hide the _ExpressibleByColorLiteral initializer from code completion.
Fixes: <rdar://problem/32726800>
2017-07-12 09:05:06 -07:00
Dave Abrahams
69eb4d6fe2 Merge pull request #10785 from xwu/silence-warnings
[gardening] Silence compiler warnings [NFC]
2017-07-11 23:13:30 -07:00
Dave Abrahams
4f71d9e35c [stdlib] Spot fix for https://bugs.swift.org/browse/SR-5401
The simplest way to keep the string buffer alive is simply to always grab its
iterator, even if we're not going to use it.  Thanks @milseman for that idea and
@jckarter for the diagnosis help!
2017-07-11 14:58:29 -07:00
lynn
51eac53c4a fix minor mistake (#10839)
* fix minor mistake

Use the `flatMap` method. Parameter transform: A closure that takes the unwrapped value, right?

* revert unwrapped
2017-07-11 00:46:33 -07:00
Károly Lőrentey
9996d071c4 [stdlib] Define custom Words types for each standard fixed with integer
This adds 8 more collection views, but makes integer definitions
more consistent across all the available bit widths and
between 32-bit and 64-bit platforms.
2017-07-11 04:53:23 +02:00
Károly Lőrentey
735fe97242 [stdlib] Fix sign extension in word -> multi-word integer conversions
This fixes integer conversion issues on 32-bit platforms.
2017-07-11 04:33:14 +02:00
Károly Lőrentey
e975445b70 [stdlib] Make UInt.Words.var internal
We don’t need Words’ members to be @_transparent;
simple conversions use _lowWord instead.
2017-07-11 03:26:20 +02:00
Károly Lőrentey
1dccb45278 [stdlib] Revert @_transparent to prevent SIL size explosion 2017-07-11 03:17:56 +02:00
Xiaodi Wu
9df52168ab Merge branch 'silence-warnings' of github.com:xwu/swift into silence-warnings 2017-07-10 16:46:40 -05:00
Xiaodi Wu
fbbe21331c Address reviewer comment 2017-07-10 16:45:24 -05:00
Károly Lőrentey
826f8daf4a [stdlib] _lowUWord => _lowWord 2017-07-10 22:40:52 +02:00
Károly Lőrentey
c8d4fd4242 [stdlib] Remove BinaryInteger._word(at:)
Removes BinaryInteger's _word(at:) requirement and its
countOfRepresentedWords property, making the words property the
sole way to access an integer's words.

This is a better fix for https://bugs.swift.org/browse/SR-5275.
2017-07-10 22:40:52 +02:00
Michael Gottesman
62ece7e07d [semantic-sil] Turn on sil ownership/the verifier by default on stdlibCore.
rdar://31880847
2017-07-10 13:39:08 -07:00
Károly Lőrentey
7836268d45 [stdlib] Implement BinaryInteger.words in standard integer types.
Introduces the following new collection types as lightweight
views of a corresponding integer value:

- UInt.Words
- UInt64.Words (on 32-bit platforms)
- DoubleWidth.Words

The rest of the standard integer types define Words as a typealias
to one of the first two of these, based on their width.
2017-07-10 19:03:34 +02:00
Xi Ge
82d9ec4634 [stdlib] Attaching document comment properly to AnyObject. NFC (#10817) 2017-07-07 16:01:47 -07:00
Max Moiseev
5f1c3f7021 [overlay] Generalize Foundation StringProtocol extensions 2017-07-07 15:34:56 -07:00
Xiaodi Wu
2c29408430 Merge branch 'master' into silence-warnings 2017-07-07 17:33:55 -05:00
Dave Abrahams
076b2e115f Merge pull request #10814 from apple/index-interchange
Index interchange
2017-07-07 15:01:17 -07:00
Joe Groff
8793212293 Merge pull request #10741 from jckarter/key-path-generic-computed
Handle generic computed properties in key paths.
2017-07-07 13:50:27 -07:00
Dave Abrahams
9159239995 Un-revert "[stdlib] String index interchange, etc." (#10812)
I failed to merge the upstream changes to swift-corelibs-foundation at the same
time as I merged that #9806, and it broke on linux. Going to get it right this
time.
2017-07-07 12:13:25 -07:00
Xi Ge
d9fb110674 Revert "[stdlib] String index interchange, etc." (#10812)
rdar://33186295
2017-07-07 12:03:16 -07:00
Dave Abrahams
0a483187b1 Merge pull request #10740 from apple/fix-unsafebufferpointer-_copyContents
[stdlib] Correct UnsafeBufferPointer._copyContents
2017-07-07 10:39:22 -07:00
swift-ci
844cce79cb Merge pull request #10809 from uunlu/master 2017-07-07 09:27:19 -07:00
Ugur Unlu
f441f53e65 [stdlib] Correct UnsafeRawPointer.bindMemory example 2017-07-07 15:29:03 +02:00
Dave Abrahams
283775ed1f [stdlib] Rebuild String.Index for UTF8View 2017-07-07 06:15:26 -07:00
Dave Abrahams
576b8de64a [stdlib] Speed String.UTF8View.count even more 2017-07-07 06:15:26 -07:00
Dave Abrahams
cf09e6b383 [stdlib] UTF8View: count by iterating
The fancy code didn't turn out to be any faster.
2017-07-07 06:15:26 -07:00
Dave Abrahams
dd3fb9b71d [stdlib] Small correction to UTF8 Iterator
This works either way I suppose, but the code is clearer now.
2017-07-07 06:15:25 -07:00
Dave Abrahams
189f1660fd [stdlib] Foundation SPI fixup 2017-07-07 06:15:25 -07:00
Dave Abrahams
b21fa4575a [stdlib] UTF8View Iterator and count specialization 2017-07-07 06:15:25 -07:00
Dave Abrahams
d94297ced1 [stdlib] Bring back some SPI that Foundation-on-linux uses. 2017-07-07 06:15:24 -07:00
Nate Cook
b9f3a2ae47 [stdlib] Minimal docs for the new string index 2017-07-07 06:15:24 -07:00
Dave Abrahams
b1d2f4c68e [stdlib] String index interchange, part III (UTF8) 2017-07-07 06:15:24 -07:00
Dave Abrahams
2e0bb2f533 [stdlib] String index interchange, part II (UTF16) 2017-07-07 06:15:23 -07:00
Dave Abrahams
e523c80339 [stdlib] Index interchange, part I 2017-07-07 00:59:04 -07:00
Joe Groff
c142e7d953 KeyPaths: Support captured arguments in computed components.
A necessary precursor to supporting subscripts and unspecialized generic accessors in general. Give get/set components the ability to have an "argument" area that gets instantiated by copying out of the key path pattern arguments at instantiation time, and which holds "witness" information for how to copy, destroy, equate, and hash arguments.
2017-07-06 20:07:41 -07:00
Xiaodi Wu
5d731c8a93 Make a fix-up to account for operator precedence 2017-07-06 20:01:09 -05:00
Maxim Moiseev
764d7d42fb Merge pull request #10791 from moiseev/no-rrc-string
[stdlib] StringProtocol no longer refines RangeReplaceableCollection
2017-07-06 13:48:19 -07:00
Max Moiseev
1a1c1a0d21 [stdlib] StringProtocol no longer refines RangeReplaceableCollection
https://bugs.swift.org/browse/SR-5379
2017-07-06 09:40:10 -07:00
Xiaodi Wu
3528479730 Silence compiler warnings 2017-07-05 23:56:44 -05:00
Xiaodi Wu
6ae074acfa [stdlib] Silence a compiler warning [NFC]
This PR updates `_FixedArray${N}` to conform to `ExpressibleByIntegerLiteral` rather than `IntegerLiteralConvertible`. This silences a compiler warning (actually, several).
2017-07-05 20:11:52 -05:00
Itai Ferber
a8ba0772cd Merge pull request #10728 from itaiferber/non-optional-coding-paths
Make coding paths non-optional [DO NOT MERGE]
2017-07-01 14:34:40 -07:00
Dave Abrahams
dc904d1378 [stdlib] Drop a premature @inline(__always) 2017-06-30 19:33:05 -07:00
Dave Abrahams
4ff733202a [stdlib] Correct UnsafeBufferPointer._copyContents
The implementation imposed stricter requirements on its inputs than those allowed by Sequence
2017-06-30 19:28:05 -07:00
Michael Ilseman
091738cf97 Merge pull request #10693 from milseman/zalgorithmic_complexity
[stdlib] Update non-contiguous NSStrings to Unicode 9
2017-06-30 14:13:39 -07:00
Itai Ferber
e1007a2e3b Make coding paths non-optional
For the benefit of unkeyed containers, coding paths currently contain optional `CodingKey`s — unkeyed containers are allowed to report a `nil` key in a path. However, this is unhelpful for debugging purposes, or inspecting the coding path for context, since any unkeyed container simply reports `nil`, whether it’s at index 1 or 1000.

Now all containers are required to report a non-optional CodingKey for their segment of the coding path, and coding paths are now exposed as `[CodingKey]`.
2017-06-30 12:43:40 -07:00
Itai Ferber
aa91b7273d Merge pull request #10667 from itaiferber/codable-encode-decode-nil-changes
Optionality updates to Codable API
2017-06-29 13:15:25 -07:00
Itai Ferber
b40c0bd3db Merge pull request #10685 from itaiferber/codingerror-bridging-and-conveniences
EncodingError/DecodingError bridging fixes and conveniences
2017-06-29 10:05:35 -07:00