You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `AnyHashableSendable` ergonomics
While working with this type I noticed a couple deficiencies:
- First, the initializer takes an opaque type rather than an
existential, and while existentials are typically automatically
opened, there are cases in which this initializer will fail,
_e.g._:
```swift
let x: (any Hashable & Sendable)?
x.map(AnyHashableSendable.init) // 🛑
```
We can fix this by updating the initializer to be an `any` already.
- Second, comparing an `AnyHashableSendable` with another
`AnyHashable` fails because of the underlying type, but there is an
underscored public protocol in the standard library we can take
advantage of that is called when a hashable type is cast to
`AnyHashable`, and if we return the base value then things like this
start to work:
```swift
AnyHashableSendable(1) == 1 as AnyHashable // true
```
* Add basic literals
* fix
* fix
0 commit comments