Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6910] Swift 4.1: Dictionary<HashableType1, HashableType2> is not Hashable #49459

Closed
NachoSoto opened this issue Feb 2, 2018 · 3 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself standard library Area: Standard library umbrella

Comments

@NachoSoto
Copy link
Contributor

Previous ID SR-6910
Radar rdar://problem/38970262
Original Reporter @NachoSoto
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 4.1 (swiftlang-902.0.34 clang-902.0.30)

Additional Detail from JIRA
Votes 0
Component/s Compiler, Standard Library
Labels Bug
Assignee @lorentey
Priority Medium

md5: 90d47260fa73af573e9d156feeab6a94

Issue Description:

Because of SR-6801, I spent an hour trying to understand why my type would not get automatic synthesis of Hashable. I narrowed it down to this:

func f<T: Hashable>(_ t: T) {}
let a: [String: String] = [:]

f(a)
Equatable.swift:4:3: error: argument type '[String : String]' does not conform to expected type 'Hashable'
f(a)
  ^
@NachoSoto
Copy link
Contributor Author

Oooh @jckarter points out that this is still WIP: #14247

@lorentey
Copy link
Member

@swift-ci create

@lorentey
Copy link
Member

SE-0143 has been amended to explicitly allow Hashable conformances for Optional, Array, ContiguousArray, ArraySlice, Dictionary, Range, and ClosedRange.

We've implemented these changes in PR #15382; it has now landed on the master branch.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants