Commit Graph

2342 Commits

Author SHA1 Message Date
Mike Ash
8a9065a369 Revert " [Foundation] Collapse (SignedInteger|UnsignedInteger) reqts into FixedWidthInteger" 2018-08-29 13:55:20 -04:00
Doug Gregor
4b625a3dda Merge pull request #19006 from DougGregor/error-bridging-integer-type
[Foundation] Collapse (SignedInteger|UnsignedInteger) reqts into FixedWidthInteger
2018-08-29 08:37:02 -07:00
Itai Ferber
3a5e0d4b74 Enable synthesized Codable impls for tests 2018-08-28 14:03:47 -07:00
Ben Cohen
83823f5f7f [stdlib] Obsolete various compatibility shims in 5.0 (#19008)
* Obsolete ModifierSlice typealiases in 5.0

* Obsolete *Indexable in 5.0

* Obsolete IteratorOverOne/EmptyIterator in 5.0

* Obsolete lazy typealiases in 5.0

* Drop .characters from tests

* Obsolete old literal protocols in 5.0

* Obsolete Range conversion helpers in 5.0

* Obsolete IndexDistance helpers in 5.0

* Obsolete Unsafe compat helpers in 5.0

* Obsolete flatMap compatibility helper in 5.0

* Obsolete withMutableCharacters in 5.0

* Obsolete customPlaygroundQuickLook in 5.0

* Deprecate Zip2Sequence streams in 5.0

* Replace * with swift on lotsa stuff

* Back off obsoleting playground conformances for now
2018-08-28 13:20:25 -07:00
Doug Gregor
4acd723d16 [Foundation] Handle unsigned error codes without trapping.
When working with Error types with unsigned raw values, numeric-cast into
a UInt and then map the bits over to an Int so we preserve values not
representable in an Int without wrapping.

Thanks to @jrose-apple for pointing this out!
2018-08-28 10:49:01 -07:00
Jordan Rose
01a0de27ec [test] Update for remote-run-ing tests on a different macOS (#18966)
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".

In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
2018-08-27 14:50:40 -07:00
Chéyo Jiménez
a527e53e17 Renamed DictionaryLiteral to KeyValuePairs (#16577)
* renamed DictionaryLiteral to KeyValuePairs per SE-0214

* renamed DictionaryLiteral type tests to KeyValuePairs

* [SE-0214] Move changelog entry (Swift 4.2 => 5.0)

* [SE-0214] Update comment in AST/Expr.h

* [SE-0214] Use generic typealias

See also <https://github.com/apple/swift/pull/17711>

* [SE-0214] Update source-stability.swift.expected
2018-08-27 10:51:12 -07:00
Ben Cohen
75018155ff Kill old set/dictionary-specific bridging entrypoints (#18930) 2018-08-25 07:27:26 -07:00
Ben Cohen
293da8fa3e [stdlib] YAIAPR (#18956)
* Scrap Comparable conformance for _SwiftNSOperatingSystemVersion

* Lazy performance needs specialization

* Uninline dump/stdout

* Bool consistency

* fixup CollectionOld

* Uninline printing functions
2018-08-24 14:00:19 -07:00
Johannes Weiss
bd2de10057 Builtin.isbitwisetakable 2018-08-24 16:03:38 +01:00
Erik Eckstein
7c06d4f8ab Remove the pinning built-ins.
They are not used anymore after removing the pinning adressors.
2018-08-23 12:47:56 -07:00
Joe Groff
44b55ae197 Runtime support for identity key paths.
Make sure the implementation can handle a key path with zero components by removing inappropriate assumptions that the number of components is always non-empty. Identity key paths also need some special behavior:

- Appending an identity key path should be an identity operation for the other operand
- Identity key paths have a `MemoryLayout.offset(of:)` zero
- Identity key paths interop with KVC as key paths to `@"self"`

To be able to exercise and test this behavior, add a `Builtin.identityKeyPath()` function and `WritableKeyPath._identity` accessor in lieu of finalized syntax.
2018-08-20 14:00:46 -07:00
Joe Groff
47f046ef52 Merge pull request #18768 from jckarter/keypath-let
Preserve 'let'-ness of stored properties in key paths.
2018-08-17 14:32:30 -07:00
Joe Groff
70c60e5186 KeyPaths: Make references to let properties properly immutable. 2018-08-17 10:59:36 -07:00
Jordan Rose
1663ee7ffd [test] Move slow StringMemoryTest to validation-test (#18776)
This test takes over a minute to run, and all it's doing is testing
that repeated operations on a string don't leak.
2018-08-17 08:46:53 -07:00
Karoy Lorentey
c88030faa0 Merge pull request #18181 from lorentey/dictionary-review
[stdlib] Modernize Set and Dictionary internals
2018-08-17 14:49:42 +01:00
Arnold Schwaighofer
76b03fe907 JSONEncoder: Also use workaround on arm
Instead of XFAILing the test try to use the workaround on arm.
This test failed on armv7k.

SR-8276
rdar://43145346
2018-08-16 13:51:51 -07:00
Karoy Lorentey
b0471b575e [test] Update Mirror tests for new Set/Dictionary internals 2018-08-16 20:05:32 +01:00
Karoy Lorentey
e2fb468b97 [stdlib] Set, Dictionary: Review native & cocoa representations
- Remove buffer suffix from type, property & variable names
  struct _NativeSetBuffer => _NativeSet
  struct _NativeDictionaryBuffer => _NativeDictionary
  struct _CocoaSetBuffer => _CocoaSet
  struct _CocoaDictionaryBuffer => _CocoaDictionary

- Remove internal typealiases related to these types
- Move nativeDelete, nativeMapValues from variant enum to corresponding struct
2018-08-16 20:05:32 +01:00
Ben Cohen
6f91a4e3dd [stdlib] Migrate remaining stdlib tests from Swift 3 (#18740)
* Migrate remaining stdlib tests from Swift 3

* Fix misprunt

* Remove seemingly pointless loops
2018-08-16 08:44:04 -06:00
Mishal Shah
3f1be3bd8c Update swift master to build with Xcode 10 beta 6, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs 2018-08-15 12:35:40 -07:00
Arnold Schwaighofer
ea600a3ecf Codesign test/stdlib/Metal.swift 2018-08-13 12:25:32 -07:00
Arnold Schwaighofer
62aa9111a3 XFAIL TestJSONEncoder.swift on armv7k
rdar://43145346
SR-8276
2018-08-10 11:27:14 -07:00
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
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
Bob Wilson
e48eb00052 Temporarily disable the stdlib/ErrorBridgedStatic.swift test
This test has been failing on the oss-swift_tools-RA_stdlib-DA_test-simulator
bot for more than a week. I finally managed to reproduce the failure
locally, so I am now disabling the test to get the bot passing again.
2018-08-08 23:47:39 -07:00
Michael Ilseman
ced2e63d95 [test] Make string internal testing a little more robust; NFC
Add an isSmall query to Character so testing doesn't have to bake in
internal format. Clarify the purpose of the invalid UTF-16 backdoor
creation method.
2018-08-02 16:34:19 -07:00
Michael Ilseman
b06c636cfa Merge pull request #18456 from milseman/internalable
[string] Internalize many faux-testable declarations
2018-08-02 13:16:08 -07:00
Philippe Hausler
b65faee23e Add unit tests for swift 4 mode 2018-08-02 10:28:43 -07:00
Michael Ilseman
ba6158d74e [test] Internalize _StringGuts; Add shared testing struct; NFC
Create a _StringRepresentation struct to standardize internal testing
on. Internalize much of _StringGuts, except for some SPI hacks, and
update tests to use _StringRepresentation.
2018-08-01 14:23:56 -07:00
Michael Ilseman
1859ae404a [test] Internalize SmallString; NFC 2018-08-01 14:23:56 -07:00
Ben Rimmington
2f326bcc88 [stdlib] Remove theGlobalMT19937
SwiftPrivate/PRNG.swift:

- currently uses `theGlobalMT19937`;
- previously used `arc4random` (see #1939);
- is obsoleted by SE-0202: Random Unification.
2018-08-01 13:00:16 +01:00
Michael Ilseman
d3f7a1615b [stdlib] Eviscerate MigrationSupport String impl
Remove many of the implementations of obsoleted String functionality
by replacing it with unreachable. A few remain temporarily until the
Foundation overlay can be updated.

Also, update TestJSONEncoder.swift off of deprecated functionality.
2018-07-31 15:42:22 -07:00
Mishal Shah
0ef312ff78 Merge pull request #18409 from apple/swift-master-xcode-10-beta-5
Update master to build with Xcode 10 beta 5, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs
2018-07-31 15:04:02 -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
Michael Ilseman
93e44f273d [test] Migrate the rest of String tests off of Swift 3; NFC 2018-07-30 18:12:34 -07:00
Morten Bek Ditlevsen
d163245a8b Merge branch 'master' into jsoncodingkeys 2018-07-28 16:44:42 +02:00
Joe Groff
9c9fa8545a IRGen: Use base-relative offsets to identify methods in fragile subclasses of resilient bases in key paths.
The resilient methods will all be keyed by their dispatch thunks, so for methods of local subclasses, we can use the offsets relative to the dynamic base as identifiers without having to adjust for that dynamic base.
2018-07-27 13:15:49 -07:00
Joe Groff
c3eafcae0e IRGen: Use method dispatch thunks to identify resilient methods in key paths.
Client code doesn't necessarily know the dispatch table indexes (and in time, there may not even be such a thing), and the dispatch thunk is a stable ABI artifact that can reliably uniquely identify the thing.
2018-07-27 13:15:49 -07:00
Joe Groff
f01c731a6b KeyPaths: Fix alignment skew issue when key path pattern ends with a less-than-pointer-aligned element. 2018-07-27 13:15:49 -07:00
Mark Lacey
78d83e5703 Use %target-typecheck-verify-swift where possible. 2018-07-26 23:13:43 -07:00
Joe Groff
665bcb99a5 Merge pull request #18100 from jckarter/keypath-external-irgen
IRGen and runtime support for key path resilience.
2018-07-25 21:04:40 -07:00
Joe Groff
4098aa02c7 KeyPaths: Support instantiating property descriptors with captured arguments. 2018-07-25 14:28:33 -07:00
Joe Groff
fceea87bf4 KeyPaths: Support instantiating generic property descriptors from concrete contexts.
This is a bit easier than the fully general case where both the external descriptor and local pattern have captured arguments (because of generics or subscript indices) since we don't have to combine the two argument files in one component.
2018-07-25 11:09:04 -07:00
Joe Groff
36882aae7a Remove test/stdlib/KeyPathImplementation test.
This was useful for bringup before compiler support for building key path patterns was implemented, but now it just hardcodes a bunch of implementation details that expose some internal details as ABI and interfere with refactorings. Remove it now that the same functionality is tested at a higher level.
2018-07-25 11:09:04 -07:00
Joe Groff
3b9501a283 KeyPaths: Handle computed property descriptor instantiation w/o indexes or generics. 2018-07-25 11:09:04 -07:00
Joe Groff
e96472807f KeyPaths: Instantiate external property descriptors for stored properties. 2018-07-25 11:09:04 -07:00
Joe Groff
7129745bf0 TBDGen: Include property descriptor in TBD output. 2018-07-25 11:09:04 -07:00
Joe Groff
f1cd3122fc KeyPaths: Stub out support for instantiating external components with trivial descriptors. 2018-07-25 11:09:04 -07:00
Stephen Canon
35db40c9f9 Make BinaryInteger._binaryLogarithm() return Int instead of Self (#18219)
Returning `Self` was probably a hack from when shifts were required to be homogenous and we didn't have good generic inits between integer types. Returning Int is more natural, because:

1. Dimensional analysis says that we shouldn't expect the logarithm to have the same type.
2. Int is guaranteed to be able to represent any object size, and BinaryInteger does not admit sparse representations, so the logarithm of the value cannot exceed allocated storage size.
3. Every single use case in the stdlib and tests is either unchanged or simplified by this change.
2018-07-25 14:04:32 -04:00