Commit Graph

5030 Commits

Author SHA1 Message Date
Joe Groff
e8e4f8b6af Hide the swift_getKeyPath entry point from the standard library API.
It's intended to be used as a runtime entry point only. rdar://problem/32200848
2017-05-15 16:24:41 -07:00
swift-ci
a61b981cd9 Merge pull request #9610 from moiseev/no-init 2017-05-15 12:04:22 -07:00
swift-ci
7fffc6036a Merge pull request #9604 from mattrajca/master 2017-05-15 10:52:58 -07:00
practicalswift
aae419ad30 [gardening] Fix word processing artefacts 2017-05-15 11:30:25 +02:00
Matt Rajca
c4736ee44b Update example for Unmanaged.toOpaque so it compiles with Swift 3
We need an explicit cast to `CFString` and assigning a string to a variable of type `CFString` is not sufficient.
2017-05-14 21:07:49 -07:00
ben-cohen
efd4edf486 Restore @inline(__always) on Collection.first 2017-05-14 14:59:48 -07:00
Michael Ilseman
fb5734c24f Merge pull request #9575 from milseman/unihan_fasterhan
[stdlib] String: Walk Chinese/Japanese faster: 2x/4x forwards/backwards
2017-05-14 13:50:15 -07:00
Ben Cohen
ea2f64cad2 [stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement (#8990)
* Give Sequence a top-level Element, constrain Iterator to match

* Remove many instances of Iterator.

* Fixed various hard-coded tests

* XFAIL a few tests that need further investigation

* Change assoc type for arrayLiteralConvertible

* Mop up remaining "better expressed as a where clause" warnings

* Fix UnicodeDecoders prototype test

* Fix UIntBuffer

* Fix hard-coded Element identifier in CSDiag

* Fix up more tests

* Account for flatMap changes
2017-05-14 06:33:25 -07:00
Max Moiseev
0a466e3ca0 Revert "[stdlib] Implementing copy constructors for integer types"
This reverts commit 3f0d1e61aa.

The copy constructors don't really solve any problems, but produce extra
work for the overload resolution.
2017-05-13 12:27:43 -07:00
Max Moiseev
12f8b390c1 [stdlib] Mark String.init?(_: String) obsoleted in Swift 4
It is still possible to get the same behavior by providing an explicit
type context, or in a generic code, but otherwise, `String("")!` will
not compile.
2017-05-13 11:45:26 -07:00
Nate Cook
dafe368220 Address @dabrahams’s feedback 2017-05-13 12:25:42 -05:00
Nate Cook
f650e0a7da [stdlib] String and range expressions
* finish string documentation revisions
* revise examples throughout to use range expressions instead of e.g.
  prefix(upTo: _)
2017-05-13 10:06:12 -05:00
Nate Cook
6dd52c5f20 [stdlib] Documentation for partial ranges and operators 2017-05-13 10:06:09 -05:00
Nate Cook
1b8d982f98 [stdlib] Miscellaneous documentation revisions
* documented swap(_:_:) and MutableCollection.swapAt(_:_:)
* clarifications and fixes elsewhere
2017-05-13 10:06:09 -05:00
Nate Cook
7fa74f590d [stdlib] Documentation revisions for string + ranges
* removing .characters from examples
* beginning new String doc revisions
* improvements to the String Foundation overlay docs
* minor revisions elsewhere
2017-05-13 10:06:05 -05:00
Nate Cook
7ec9e95b49 [stdlib] Documentation revisions for numeric types
* abstracts for integer types
* fixed discussions for floating-point operators
2017-05-13 10:06:00 -05:00
Dave Abrahams
4dee6ead5c [stdlib] Provisional c[...] syntax while we await language features 2017-05-12 22:14:17 -07:00
swift-ci
5d034a2f71 Merge pull request #9568 from apple/stdlib-coding-convention 2017-05-12 21:43:48 -07:00
Dave Abrahams
dfd967281b [stdlib] 80 columns and other coding convention violations 2017-05-12 20:48:35 -07:00
Max Moiseev
f8bb0d88d7 Revert "[stdlib] Removing a String.init?(_: String), non-failable is enough"
This reverts commit 46415e7dbd.
2017-05-12 20:47:34 -07:00
Kuba (Brecka) Mracek
a5a59f5aed [runtime] Enhance output from dynamic exclusivity violations. Print current stacktrace and the symbolicated frame of the previous conflicting access. (#9501) 2017-05-12 20:28:28 -07:00
Max Moiseev
6e3ae3aa4e [stdlib] Disambiguating count in Character._SmallUTF's 2017-05-12 17:37:04 -07:00
Max Moiseev
3f0d1e61aa [stdlib] Implementing copy constructors for integer types 2017-05-12 17:37:04 -07:00
Kuba (Brecka) Mracek
fc7dbefcf8 Revert backtrace ban and start printing backtraces from the runtime again (#9528)
* Revert "[strip -ST] Disable runtime stack trace dumping on Darwin when asserts are disabled."
This reverts commit 6bc28ff1c9.
* Bring back important fixes from the revert of 6bc28ff1c9.
* Change swift::swift_reportError to only print the backtrace in assert builds (swift::warning prints backtrace always).
2017-05-12 15:46:35 -07:00
swift-ci
00392ecb53 Merge pull request #9553 from moiseev/covariance-ftw 2017-05-12 15:25:49 -07:00
Max Moiseev
46415e7dbd [stdlib] Removing a String.init?(_: String), non-failable is enough 2017-05-12 14:48:30 -07:00
swift-ci
2df2c6218c Merge pull request #9547 from moiseev/remove-files 2017-05-12 13:31:30 -07:00
Dave Abrahams
2cb11675cf Merge pull request #9531 from apple/core-team-resolution-2017-05-10.1
Implementing resolutions of core team meeting 2017-05-10
2017-05-12 13:15:08 -07:00
Michael Ilseman
f08ee0fd93 [stdlib] Walk Chinese/Japanese faster: 2x/4x forwards/backwards
This adds more fast path checks for grapheme breaks between BMP
scalars. Notably the rather vast range of 0x3400–0xA4CF which includes
unified common Han ideographs as well as the first extension to
unified Han ideographs. It also happens to pick up various Yijin and
Yi symbols/radicals. Additionally, the narrow hiragana/katakana ranges
0x3041-0x3096 and 0x30A1-0x30FA (including pre-composed semi-voiced
characters but excluding the combining semi-voice marks) have fast
paths.

The net effect is that the vast majority of modern Chinese and
Japanese text should be fast-pathed. This is especially important, as
adopting Unicode 9 might otherwise pessimize performance here relative
to the tries.
2017-05-12 13:13:33 -07:00
Max Moiseev
f1439b8045 [stdlib] Remoiving old integers 2017-05-12 11:48:32 -07:00
swift-ci
2441b778f5 Merge pull request #9530 from itaiferber/foundation-codingpath-fixes 2017-05-12 10:25:31 -07:00
Matt Rajca
c6ac96ba78 Foundation Overlay: AffineTransform.rotate(byRadians:) is wrong (#9481)
Currently, AffineTransform.rotate(byRadians:) simply assigns the sines and cosines to
the transformation matrix, throwing away information about the current scale, rotation, etc.

This patch performs a proper rotation by concatenating the rotation matrix.
2017-05-12 09:27:31 -07:00
Dave Abrahams
8137d7dbaf [stdlib] Temporarily disable availability annotations
PlaygroundLogger is using Swift 4 mode, thus we have to land this, update that,
and then add the availability annotations later.
2017-05-12 05:11:50 -07:00
Joe Groff
ed2612fe2d Merge pull request #9516 from jckarter/objc-keypath-id
SILGen/IRGen/KeyPaths: Components for ObjC properties need to be identified by selector.
2017-05-11 19:33:21 -07:00
Dave Abrahams
41c244a065 [stdlib] Unicode[Encoding|Parser] => Unicode.[Encoding|Parser] 2017-05-11 17:21:39 -07:00
Mishal Shah
96ea67dc87 Merge pull request #9512 from airspeedswift/come-back-where-clauses-we-miss-you
[stdlib] Revert addition of some recursive where clauses on Collection protocols
2017-05-11 17:11:33 -07:00
Itai Ferber
3a9d888972 Fix JSON+plist codingPaths for nested values
codingPath more often than not actually needs to be copied, not just
referenced. This makes a big difference for nested containers and
subobjects, which were getting the wrong codingPath values when asking
for them.

This also adds unit tests for JSONEncoder and PropertyListEncoder to
confirm expected behavior.
2017-05-11 17:02:46 -07:00
Dave Abrahams
01d886fe3d [stdlib] Swift.UTF[8|16|32] availability 2017-05-11 15:23:25 -07:00
Dave Abrahams
ddf7ad517f UnicodeScalar => Unicode.Scalar 2017-05-11 15:23:25 -07:00
Dave Abrahams
97f875ad84 [stdlib] De-underscore Unicode "namespace" 2017-05-11 15:23:25 -07:00
Joe Groff
9830f394c1 SILGen/IRGen/KeyPaths: Components for ObjC properties need to be identified by selector.
A property imported from Objective-C, or marked in Swift with the `dynamic` keyword, doesn't have a vtable slot, so can't be identified that way. Use the ObjC selector as the unique identifier to ascribe equality to such components. Fixes rdar://problem/31768669. (While we're here, throw some more execution tests and a changelog note in.)
2017-05-11 14:28:19 -07:00
Maxim Moiseev
e868ca7035 [stdlib] Better BinaryInteger.signum and tests 2017-05-11 14:02:59 -07:00
Max Moiseev
a797b29c1c [stdlib] A more efficient implementation of signum for integer types 2017-05-11 14:02:59 -07:00
Ben Cohen
d95704128d revert changes to stdlib 2017-05-11 12:05:47 -07:00
Ben Cohen
c03b14e93f Revert "Merge pull request #9379 from airspeedswift/redundant-where"
95e9681d10
2017-05-11 11:43:54 -07:00
Michael Ilseman
f0abff5539 Revert "Merge pull request #9265 from milseman/tls_ftw"
This reverts commit 26f7659efe, reversing
changes made to 7b927e55e8.
2017-05-11 10:39:58 -07:00
Doug Gregor
e813455036 Merge pull request #9504 from practicalswift/gardening-20170511
[gardening] Fix duplicate include. Add copyright notice. Fix typo.
2017-05-11 09:57:18 -07:00
Philippe Hausler
9fa3cec738 [Foundation] IndexPath should not cause numeric overflow in addition to calculate hash values (#9476) 2017-05-11 09:00:25 -07:00
practicalswift
8a26719344 [gardening] Fix duplicate include. 2017-05-11 16:04:48 +02:00
practicalswift
b99c62b459 [gardening] Add missing copyright notice 2017-05-11 15:54:36 +02:00