Skip to content

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