ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.37k stars 4.17k forks source link

Cannot call value of non-function type '[Observable<Event>.Type]' #2548

Closed DK3369 closed 1 year ago

DK3369 commented 1 year ago

Xcode 15.0 Mac Book Pro M1

Feedbacks.swift

private func bindingsStrongify<Event, O, WeakOwner>(_ owner: WeakOwner, _ bindings: @escaping (WeakOwner, O) -> (Bindings<Event>))
    -> (O) -> (Bindings<Event>) where WeakOwner: AnyObject {
    return { [weak owner] state -> Bindings<Event> in
        guard let strongOwner = owner else {
            return Bindings(subscriptions: [], events: [Observable<Event>]())
        }
        return bindings(strongOwner, state)
    }
}
截屏2023-10-16 下午5 20 00
danielt1263 commented 1 year ago

The compiler is confusing the Swift.Observable type with the RxSwift.Observable type. Use: return Bindings(subscriptions: [], events: [RxSwift.Observable<Event>]()) instead.

freak4pc commented 1 year ago

Feedbacks.swift is part of the example project and not the library itself so I don't think it's very relevant. Worth fixing but not a blocker for consumers. Closing for now, thanks