Conversation
|
@swift-ci please test |
| } | ||
| } | ||
|
|
||
| extension FilePath.Component { |
There was a problem hiding this comment.
| extension FilePath.Component { | |
| extension FilePath.Component: Hashable { |
@lorentey would this be possible to do (without availability) as the ABI-stable build picked up the symbols?
Also, would we still need the public func below if we added the conformance explicitly?
There was a problem hiding this comment.
The sinking of the Equatable/Hashable conformances from _StrSlice to Component is probably fine, ABI-wise. If any other public type conformed to _StrSlice, then it'll need to do the same.
_StrSlice will need to stop conforming to Equatable/Hashable.
| } | ||
| extension _StrSlice { | ||
| public static func == (lhs: Self, rhs: Self) -> Bool { | ||
| public static func strSliceEqual(lhs: Self, rhs: Self) -> Bool { |
There was a problem hiding this comment.
If we want to go this way, let's at least put an end to adding any new public members of internal types. That only leads to sadness.
| public static func strSliceEqual(lhs: Self, rhs: Self) -> Bool { | |
| internal static func strSliceEqual(lhs: Self, rhs: Self) -> Bool { |
| } | ||
|
|
||
| extension FilePath.Component { | ||
| public static func == (lhs: Self, rhs: Self) -> Bool { |
There was a problem hiding this comment.
Unfortunately, this would be a newly exported symbol, so it needs to come with an availability declaration.
To clean up the mess that resulted from adding public members to an internal type, we should add this implementation in a form that is back-deployable.
| return Self.strSliceEqual(lhs: lhs, rhs: rhs) | ||
| } | ||
|
|
||
| public func hash(into hasher: inout Hasher) { |
There was a problem hiding this comment.
Same problem here -- this is a new symbol, so it needs to either have an @available attribute combined with @backDeployed(before:), or it needs to be declared @_alwaysEmitIntoClient.
| lhs._slice.elementsEqual(rhs._slice) | ||
| } | ||
| public func hash(into hasher: inout Hasher) { | ||
| public static func == (lhs: Self, rhs: Self) -> Bool { |
There was a problem hiding this comment.
We should remove this function altogether. (After verifying that it doesn't end up getting exported somehow in the ABI stable binary.)
| hasher.combine(element) | ||
| } | ||
| } | ||
| public func hash(into hasher: inout Hasher) { |
There was a problem hiding this comment.
Same here -- this function should not exist.
| return Self.strSliceEqual(lhs: lhs, rhs: rhs) | ||
| } | ||
|
|
||
| public func strSliceHash(into hasher: inout Hasher) { |
There was a problem hiding this comment.
| public func strSliceHash(into hasher: inout Hasher) { | |
| internal func strSliceHash(into hasher: inout Hasher) { |
|
I'll see if I can add a commit to this PR to make it work in all configurations of System later today! |
alternative (to #139) fix for #138