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

[AnyHashable] Eliminate the _AnyHashableProtocol hack. #5132

Closed

Conversation

DougGregor
Copy link
Member

Now that we have the ability to write extensions where one of the type
parameters is equivalent to a concrete type, eliminate
_AnyHashableProtocol and provide AnyHashable-specific behavior for
Dictionary (where Key == AnyHashable) and Set (where Element == AnyHashable) rather than employing the Key: _AnyHashableProtocol
hack.

Fixes standard library ABI FIXME's #35, #37, #39.

Now that we have the ability to write extensions where one of the type
parameters is equivalent to a concrete type, eliminate
_AnyHashableProtocol and provide AnyHashable-specific behavior for
Dictionary (where Key == AnyHashable) and Set (where Element ==
AnyHashable) rather than employing the "Key: _AnyHashableProtocol"
hack.

Fixes standard library ABI FIXME's swiftlang#35, swiftlang#37, swiftlang#39.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@slavapestov
Copy link
Contributor

Looks like this exposed a SIL printer bug... oops

@DougGregor
Copy link
Member Author

@slavapestov , are you planning to look into the SIL printer issue?

@slavapestov
Copy link
Contributor

I can take a look, sure. I think I know what it is.

@DougGregor
Copy link
Member Author

It's printing out a generic signature:

<AnyHashable where AnyHashable == AnyHashable>

Which is valid but very much not what we want ;)

@slavapestov
Copy link
Contributor

@DougGregor Yeah, the SIL printer wants to map type parameters to archetypes for some reason, I think to recover names because it starts with canonical type parameters. I've wanted to refactor this, to fix this very issue. Surprised it hasn't come up before.

@slavapestov slavapestov self-assigned this Oct 5, 2016
@slavapestov
Copy link
Contributor

Fix is still not quite done, but it's coming along: slavapestov@3e031ff

@slavapestov
Copy link
Contributor

Hi Doug, I rebased this and merged it as part of #5266. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants