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

[SR-11806] Protocol inheritance with associated type causes build failure based on source layout #54217

Closed
swift-ci opened this issue Nov 19, 2019 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11806
Radar rdar://problem/57348897
Original Reporter silverhammermba (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Reproduced with Xcode 10.3 and 11.2 on Mac OS 10.14.6.

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: f6b5244f91535b97be3e0f56a22a9ffb

Issue Description:

There seem to be four parts to this bug

  1. Protocol A has an associated type

  2. Protocol B has its own associated type and conforms to protocol A. I wrote an extension of B to implement the conformance

  3. Struct S conforms to protocol B

  4. Function F uses A's methods on S

If S and F are in the same file it builds and runs successfully. If I put S and F in different files I get compiler errors:

Type 'S' does not conform to protocol 'A'
Type 'S' does not conform to protocol 'B'

If I remove any of the above four parts, it builds successfully regardless of where I put S and F.

See attached Swift file.

@beccadax
Copy link
Contributor

@swift-ci create

@CodaFi
Copy link
Member

CodaFi commented Nov 20, 2019

I can't reproduce this with a master compiler but I can reproduce it with swiftlang-1103.0.1 clang-1103.0.17.90. silverhammermba (JIRA User) can you try a recent toolchain snapshot and let me know if it still shows up?

@swift-ci
Copy link
Collaborator Author

Comment by Maxwell Anselm (JIRA)

I tried the latest trunk development snapshot in Xcode and that fixes the build error.

@CodaFi
Copy link
Member

CodaFi commented Nov 21, 2019

Resolved on master.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants