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

both operands of "===" should be AnyObject #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EdgarDegas
Copy link

No description provided.

@PatrickWeigel
Copy link

This eliminates the compiler error. But does it eliminate the root cause? That is, should $0 be Any Object?

@tkrajacic
Copy link

tkrajacic commented Apr 21, 2018

The correct A better fix for this would be to change the extension to:

extension Sequence where Element: AnyObject

While the iterator also uses the Element associated type and that one is constrained to be equal to the Sequence's Element type, the type system only checks the Sequence's Element type in this case, so it can't establish that every element of the Sequence is also an AnyObject anyway when only the Iterator's Element is specified.

Hope that makes sense.

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.

3 participants