Commit Graph

6 Commits

Author SHA1 Message Date
Slava Pestov
e0bba70923 Foundation: Provide a Hashable.hashValue witness for _BridgedStoredNSError conformers
Previously we would synthesize this in Sema, but this no longer
works when conformance checking is triggered by SILGen.
2019-05-18 11:35:05 -04:00
Mike Ash
fa5888fb3f [Stdlib][Overlays] Rename various classes to avoid conflicting ObjC names.
Old Swift and new Swift runtimes and overlays need to coexist in the same process. This means there must not be any classes which have the same ObjC runtime name in old and new, because the ObjC runtime doesn't like name collisions.

When possible without breaking source compatibility, classes were renamed in Swift, which results in a different ObjC name.

Public classes were renamed only on the ObjC side using the @_objcRuntimeName attribute.

This is similar to the work done in pull request #19295. That only renamed @objc classes. This renames all of the others, since even pure Swift classes still get an ObjC name.

rdar://problem/46646438
2019-01-15 12:21:20 -05:00
Karoy Lorentey
23188afec1 [Foundation] CocoaError.Code, URLError.Code: Remove hashValue implementation
These implementations did not produce the same hash values as the raw value. RawRepresentable provides a correct hashing implementation by default, so let’s just use that.
2018-12-10 13:00:57 +00:00
Karoy Lorentey
21d31ea6d9 [Foundation] _Bridged[Stored]NSError: Remove explicit impls for hashValue/_rawHashValue
The compiler-synthesized / stdlib-provided default implementations seem perfectly fine for these.
2018-12-10 13:00:57 +00:00
Karoy Lorentey
bbaec3d8bd [Foundation] Update hashing for bridged Error/NSError types
Protocols in resilient libraries that wish to provide a default implementation of hashing need to do so by providing a hash(into:) implementation.

hashValue has been deprecated as a Hashable requirement in SE-0206. Implementing only it in a protocol extension curses conforming types to get deprecation warnings by default.
2018-12-10 13:00:56 +00:00
Saleem Abdulrasool
41d9c2cc59 stdlib: restructure for OS family layout of SDK overlay
The SDK directory is now confusing as the Windows target also has a SDK
overlay.  In order to make this more uniform, move the SDK directory to
Darwin which covers the fact that this covers the XNU family of OSes.
The Windows directory contains the SDK overlay for the Windows target.
2018-12-06 11:32:05 -08:00