Commit Graph

11 Commits

Author SHA1 Message Date
Karoy Lorentey
18e7470ae7 [Foundation] NSArray, NSDictionary: Add custom AnyHashable representations
Now that Array and Dictionary conform to Hashable, we need to make sure that their bridged counterparts provide the same hash values when converted to AnyHashable.
2018-03-23 19:08:39 +00:00
Karoy Lorentey
3982875da0 Use Dictionary’s subscript setter rather than updateValue
It doesn’t matter which value we keep, and since we don’t currently check for duplicate values, there is no reason to retrieve the old value.
2018-01-20 00:58:44 +00:00
Karoy Lorentey
9e4dcd8bae [Foundation] Coalesce duplicate keys in String-keyed NSDictionary and NSSet instances
NSString has a stricter concept of equality than Swift’s String, so it is possible to construct NSDictionary/NSSet instances that contain duplicate keys according to Swift’s definition of string equality. This change improves how we handle these cases by coalescing the duplicate keys (keeping a single value).

rdar://problem/35995647
2018-01-19 22:35:59 +00:00
taylor swift
c85880899d implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods 2017-11-17 21:28:03 -08:00
Philippe Hausler
ce3ccfbd9b Change shims to always be counted as system headers via -isystem instead of conditionally marking them in debug versus non debug builds. (#7979) 2017-03-09 16:09:16 -08:00
Philippe Hausler
dc783c064c [Foundation] Remove @_silgen thunks and replace them with shims instead
This avoids indirection by making calls directly to the C implementations which prevents potentials of mismatched intent or changes of calling convention of @_silgen. The added benefit is that all of the shims in this case are no longer visible symbols (anyone using them was not authorized out side of the Foundation overlay). Also the callout methods in the headers now all share similar naming shcemes for easier refactoring and searching in the style of __NS<class><action> style. The previous compiled C/Objective-C source files were built with MRR the new headers MUST be ARC by Swift import rules.

The one caveat is that certain functions MUST avoid the bridge case (since they are part of the bridging code-paths and that would incur a recursive potential) which have the types erased up to NSObject * via the macro NS_NON_BRIDGED.

The remaining @_silgen declarations are either swift functions exposed externally to the rest of Swift’s runtime or are included in NSNumber.gyb which the Foundation team has other plans for removing those @_silgen functions at a later date and Data.swift has one external function left with @_silgen which is blocked by a bug in the compiler which seems to improperly import that particular method as an inline c function.
2017-03-06 09:59:37 -08:00
practicalswift
3918d9d251 [gardening] Replace likely word processor artefacts with ASCII equivalents (— → --, … → ...) 2017-01-08 15:23:06 +01:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
JP Simard
65688bdc39 [gardening] replace unused closure parameters with '_' in stdlib source (#6522)
* replace unused closure parameters with '_' in stdlib source

* fold some _ closure arguments into line above

* fold more _ closure arguments into line above
2017-01-03 20:10:41 -07:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Philippe Hausler
c3bcd0dc18 [Foundation] Extract NSDictionary extensions into a seperate file
Non functional change; purely organization/gardening
2016-10-03 12:37:25 -07:00