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-6658] ReactiveCocoa source breakage: error: type 'DynamicProperty<Value>' does not conform to protocol 'MutablePropertyProtocol' #49207

Open
lplarson opened this issue Dec 22, 2017 · 6 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.1

Comments

@lplarson
Copy link
Member

Previous ID SR-6658
Radar rdar://problem/36200459
Original Reporter @lplarson
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.1Regression
Assignee @DougGregor
Priority Medium

md5: c2bfdb104cf3f86f2cacee87509c6c2f

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 ReactiveCocoa --assertions

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

FAIL: ReactiveCocoa, 3.1, afe5b3, ReactiveCocoa-macOS, generic/platform=macOS
FAIL: ReactiveCocoa, 3.1, afe5b3, ReactiveCocoa-iOS, generic/platform=iOS
FAIL: ReactiveCocoa, 3.1, afe5b3, ReactiveCocoa-tvOS, generic/platform=tvOS
FAIL: ReactiveCocoa, 3.1, afe5b3, ReactiveCocoa-watchOS, generic/platform=watchOS

https://ci.swift.org/view/Source%20Compatibility/job/swift-master-source-compat-suite/961/artifact/swift-source-compat-suite/XFAIL_ReactiveCocoa_3.1_BuildXcodeWorkspaceScheme_ReactiveCocoa-iOS_generic-platform-iOS.log

/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/NSObject+Synchronizing.swift:2:11: warning: functions in a protocol extension do not need to be marked with 'final'
        internal final func synchronized<Result>(execute: () throws -> Result) rethrows -> Result {
                 ^~~~~~
                 
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:11:20: error: type 'DynamicProperty<Value>' does not conform to protocol 'MutablePropertyProtocol'
public final class DynamicProperty<Value>: MutablePropertyProtocol {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:17:13: note: candidate has non-matching type 'Value?'
        public var value: Value? {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:11:20: error: type 'DynamicProperty<Value>' does not conform to protocol 'PropertyProtocol'
public final class DynamicProperty<Value>: MutablePropertyProtocol {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:17:13: note: candidate has non-matching type 'Value?' [with Value = DynamicProperty.Value]
        public var value: Value? {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:38:13: note: candidate has non-matching type 'SignalProducer<Value?, NoError>' [with Value = DynamicProperty.Value]
        public var producer: SignalProducer<Value?, NoError> {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:43:31: note: candidate has non-matching type 'Signal<Value?, NoError>' [with Value = DynamicProperty.Value]
        public private(set) lazy var signal: Signal<Value?, NoError> = {
                                     ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:11:20: error: type 'DynamicProperty<Value>' does not conform to protocol 'BindingSource'
public final class DynamicProperty<Value>: MutablePropertyProtocol {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:11:20: note: do you want to add protocol stubs?
public final class DynamicProperty<Value>: MutablePropertyProtocol {
                   ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:19:46: warning: treating a forced downcast to 'Value' as optional will never produce 'nil'
                        return object?.value(forKeyPath: keyPath) as! Value
                                                                  ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:19:48: note: use 'as?' to perform a conditional downcast to 'Value'
                        return object?.value(forKeyPath: keyPath) as! Value
                                                                    ^
                                                                    ?
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:19:11: note: add parentheses around the cast to silence this warning
                        return object?.value(forKeyPath: keyPath) as! Value
                               ^
                               (                                           )
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:40:14: warning: treating a forced downcast to 'Value' as optional will never produce 'nil'
                        .map { $0 as! Value }
                                  ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:40:16: note: use 'as?' to perform a conditional downcast to 'Value'
                        .map { $0 as! Value }
                                    ^
                                    ?
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:40:11: note: add parentheses around the cast to silence this warning
                        .map { $0 as! Value }
                               ^
                               (           )
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:45:62: error: cannot assign value of type 'Signal<Value?, NoError>' to type 'Signal<Value, NoError>!'
                self.producer.startWithSignal { innerSignal, _ in signal = innerSignal }
                                                                           ^~~~~~~~~~~
                                                                                       as! Signal<Value, NoError>
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/DynamicProperty.swift:46:10: error: cannot convert return expression of type 'Signal<Value, NoError>!' to return type 'Signal<Value?, NoError>'
                return signal
                       ^~~~~~
                              as! Signal<Value?, NoError>
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/ObjC+RuntimeSubclassing.swift:26:8: warning: no calls to throwing functions occur within 'try' expression
                try! ReactiveCocoa.synchronized(subclass) {
                     ^
/Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/project_cache/ReactiveCocoa/ReactiveCocoa/NSObject+Intercepting.swift:80:9: warning: no calls to throwing functions occur within 'try' expression
                        try! ReactiveCocoa.synchronized(subclass) {
                             ^
@slavapestov
Copy link
Member

@swift-ci create

@NachoSoto
Copy link
Contributor

I want to point out that because of this, and ReactiveCocoa being disabled from the source-compatibility suite, a regression was introduced in Swift 4.1: SR-6796.

@rudkx
Copy link
Member

rudkx commented Feb 8, 2018

Is this a case where this issue has been worked-around upstream and we just haven't updated the version we're pulling and un-XFAILed the test case?

@NachoSoto
Copy link
Contributor

I have no idea, no ReactiveCocoa contributor has been contacted as a consequence of this, and we didn't see this in particular on any Xcode update. I just happened to run into this Jira by coincidence.

@lplarson
Copy link
Member Author

Hi @NachoSoto, thanks for the notification. From what I can see, this JIRA matches the issue that's actually occurring in the 4.1 source compat runs on Jenkins.

I looked at the ReactiveSwift source code for the current hash in the compat suite and the affected source code exists, meaning, as you explained in your first post, this issue prevented us from seeing the new source breakage.

I'm reaching out to the designated ReactiveCocoa maintainer to request a hash update (which is pinned to a newer ReactiveSwift hash), as newer hashes aren't affected by the issue reported in this JIRA and should reveal the newer source breakage.

This JIRA can be used to continue tracking this issue.

@NachoSoto
Copy link
Contributor

Thanks @lplarson!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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 swift 4.1
Projects
None yet
Development

No branches or pull requests

5 participants