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

ArraySection compile error: Type 'C' constrained to non-protocol, non-class type [Element] #72

Closed
cnstoll opened this issue May 30, 2019 · 5 comments

Comments

@cnstoll
Copy link

cnstoll commented May 30, 2019

Great. This template thing completely removed what I wrote.

@cnstoll
Copy link
Author

cnstoll commented May 30, 2019

Since I can't really re-write all of that, basically I'm getting the error in the title trying to compile ArraySection in Xcode 10.2.1.

Screen Shot 2019-05-29 at 7 04 24 PM

For some reason that I can't explain, changing Collection to Sequence fixes it. 🤷‍♂

Screen Shot 2019-05-29 at 10 22 31 PM

I think this is related to a recent update that added the Element associated type, but I'm honestly not sure.

@cnstoll
Copy link
Author

cnstoll commented Jun 8, 2019

It looks like this is a namespacing issue. The compiler thinks that "Collection" is the DifferenceKit's Collection instead of the Swift.Collection version. Changing "Collection" to "Swift.Collection" also fixes this error.

@ra1028
Copy link
Owner

ra1028 commented Jun 17, 2019

Hi @cnstoll ,

Thanks for your reporting.
I can compile without problems in my environment.
Let me know more about your situation according to issue template you deleted?
https://github.com/ra1028/DifferenceKit/blob/master/.github/ISSUE_TEMPLATE/QUESTION.md

@larsacus
Copy link

I can confirm this is a result of the namespace aliasing between Swift.Collection and the "re-defined" associated type Collection: Swift.Collection where Collection.Element: Differentiable in DifferentiableSection.swift. Same workaround as above "fixes" the issue, but there may be some other lingering issues with having this associated type named the same as a system type.

Xcode 10.2, Swift 4.2

@ra1028 ra1028 closed this as completed Mar 31, 2020
@AnisovAleksey
Copy link

The same issue. Reproduced only in Archive, debug build works fine.

Xcode: 12.5
Cocoapods: 1.10.1
Library version: 1.2.0

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

No branches or pull requests

4 participants