Peter-Schorn/SpotifyAPI

Invalid redeclaration of synthesized implementation for protocol requirement 'allCases'

Closed this issue · 14 comments

Hello @Peter-Schorn , thanks for this great library.
However, I cannot build it in my project. I have tried from version 1.1.2 to 1.5.1 and I get same error:

Invalid redeclaration of synthesized implementation for protocol requirement 'allCases'

XCode returns several errors and I am attaching them:

Screen Shot 2021-04-16 at 10 07 33

Screen Shot 2021-04-16 at 10 09 46

I have no idea how to fix those errors. Could you please guide?

The library builds just fine for me. Try building it by itself without attaching it to any project. If it builds fine by itself, then link me to the full project that you are using it in. Furthermore, please tell me about the swift version and platform that you are building on.

Ok, I think I know exactly why you are unable to build the library: You're using a version of swift prior to 5.2, which was when SE-0249 was introduced, which allows you to use key path literals as functions. Is there a reason why you haven't updated yet?

Same issue:
Screen Shot 2021-04-26 at 4 11 13 PM

This was introduced w/ Xcode Version 12.5 (12E262); same code complied w/out issue in the previous Xcode version.

(Swift is 5.2)

Any ideas?

You're using Swift 5.2 with Xcode 12.5? Why? Swift 5.3.2, was released along with Xcode 12.3.

Xcode 12.5 was released along with swift 5.4, which I'm about to update to.

You can depend on the swift-tools-5-1 branch if you want, which supports Swift 5.1 and 5.2, unlike master. However, I will make no guarantees about keeping it up to date with master. Is there a reason why you're still using Swift 5.2?

apologies, typo: Swift 5.x.

LMK if you have the same experience w/ Xcode 12.5

apologies, typo: Swift 5.x.

So then which minor version are you using? It's important. master does not compile on versions of swift before 5.2, because this was when Key Path Expressions as Functions was introduced.

Are you able to build the swift-tools-5-1 branch?

The Xcode 12.4/Swift version (on which the library complied w/out issue):
Screen Shot 2021-04-26 at 4 50 10 PM

The Xcode 12.5 version (on which the library has the compiler errors above):
Screen Shot 2021-04-26 at 4 50 13 PM

I haven't tried the swift-tools-5-1 branch.

So it's not compiling on swift 5.4? I'll have to look into that. I'm still waiting for the Xcode update to complete.

Correct. Upon update to 5.4/Xcode 12.5 the errors showed during a build. There was no change to the code, just an Xcode update.

Ok I figured it out: It's a bug. See here.

I've just pushed a commit that fixes this issue.

TY for addressing so quickly. You are appreciated!

:)