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-8966] Ordering of mutually referring protocols can provoke error #51471

Closed
tjw opened this issue Oct 10, 2018 · 3 comments
Closed

[SR-8966] Ordering of mutually referring protocols can provoke error #51471

tjw opened this issue Oct 10, 2018 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@tjw
Copy link
Contributor

tjw commented Oct 10, 2018

Previous ID SR-8966
Radar None
Original Reporter @tjw
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS 10.13.6
Xcode 10.0 (10A254a)

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

md5: 980d7641f418602d81506f9fc9297381

relates to:

  • SR-8968 Crash compiling mutually referring protocols with static var

Issue Description:

With a system of mutually referencing protocols, I ran into a strange build error. Reordering the protocols allowed the compile to succeed.

Using the Xcode 10 tools, compile the attached sample with `xcrun swiftc recursive-protocol-ordering.swift`. This results in:

recursive-protocol-ordering.swift:26:17: error: static method requirement 'baseMessageName()' cannot add constraint 'Self == Self.ChangeType.SnapshotType.ChangeType.SnapshotType.RecordType.SnapshotType' on 'Self'
    static func baseMessageName() -> String
                ^

As noted in the example, reordering the protocols allows the file to compile.

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Oct 12, 2018

cc @DougGregor, @slavapestov what is the expected behavior here?

@slavapestov
Copy link
Member

It's not expected because changing the order of declarations should not change the meaning of the code.

@tjw
Copy link
Contributor Author

tjw commented Oct 8, 2019

I'm no longer seeing this issue in Xcode 11.2b1.

@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

2 participants