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-5265] ProcedureKit source breakage: error: instance method 'add(observer:)' in non-final class 'Procedure' cannot be used to satisfy requirement instance method 'add(observer:)' #47840

Closed
lplarson opened this issue Jun 20, 2017 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression source compatibility swift 4.0

Comments

@lplarson
Copy link
Member

Previous ID SR-5265
Radar rdar://problem/32861329
Original Reporter @lplarson
Type Bug
Status Resolved
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.0Regression, SourceCompatibility
Assignee @lplarson
Priority Medium

md5: 24b699e5a4091a0413af33ad06fdf6b2

is duplicated by:

  • SR-6618 ProcedureKit source breakage: error: instance method 'add(observer:)' in non-final class 'Procedure' cannot be used to satisfy requirement instance method 'add(observer:)'

Issue Description:

To reproduce:

  1. Install latest GM/Beta Xcode
  2. $ git clone git@github.com:apple/swift-source-compat-suite.git
  3. $ cd swift-source-compat-suite

To build Swift from scratch before testing:
4. $ ./reproduce.py master --project-path ProcedureKit

Or if you've already built Swift:
4. $ ./reproduce.py master --project-path ProcedureKit --swiftc path/to/swiftc

https://ci.swift.org/view/Source%20Compatibility/job/swift-master-source-compat-suite/637/artifact/swift-source-compat-suite/FAIL_BuildXcodeProjectTarget_ProcedureKit-ProcedureKit-xcodeproj_ProcedureKit_generic-platform-iOS.log

/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ProcedureKit/Sources/ProcedureKit/Procedure.swift:1108:15: error: instance method 'add(observer:)' in non-final class 'Procedure' cannot be used to satisfy requirement instance method 'add(observer:)' (in protocol 'ProcedureProtocol') due to same-type requirement involving 'Self'
    open func add<Observer: ProcedureObserver>(observer: Observer) where Observer.Procedure == Procedure {
              ^
@lplarson
Copy link
Member Author

@swift-ci create

@belkadan
Copy link
Contributor

cc @DougGregor

@DougGregor
Copy link
Member

We discussed this, and it's a necessary source break---ProcedureKit is depending on a type soundness hole in the generics system, the presence of which can lead to run-time failures, "miscompiles", and optimizer crashes. The workaround is to use ": Procedure" instead of "== Procedure".

@lplarson
Copy link
Member Author

lplarson commented Dec 2, 2017

Advanced project hash to a version that resolved this issue.

apple/swift-source-compat-suite#114

@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 regression source compatibility swift 4.0
Projects
None yet
Development

No branches or pull requests

4 participants