mattgallagher / CwlSignal

A Swift framework for reactive programming.
ISC License
304 stars 33 forks source link

Playground errors - commit 73258ba ( Nov. 26, 2017 ) #20

Closed chh51 closed 6 years ago

chh51 commented 6 years ago

Five of the playground examples are failing compile. All others are Ok.

BTW: Impressive software and documentation

  1. Advanced composition - nested operators

`error: CwlSignal.playground:27:6: error: cannot assign value of type 'SignalChannel<DispatchTimeInterval, SignalMultiInput, Result, SignalMulti<Result>>' to type '(SignalMultiInput, SignalMulti<Result>)' }.multicast()


`

2. Advanced composition - loopback

`error: CwlSignal.playground:50:29: error: cannot convert value of type 'Result<String>' to expected argument type 'Result<()>'
        loopbackInput.send(result: r)
                                   ^`

3. App scenario - threadsafe key-value storage

`error: CwlSignal.playground:50:5: error: cannot assign value of type 'SignalChannel<DocumentValues.Tuple, SignalInput<DocumentValues.Tuple>, [AnyHashable : Any], SignalMulti<[AnyHashable : Any]>>' (aka 'SignalChannel<(AnyHashable, Optional<Any>), SignalInput<(AnyHashable, Optional<Any>)>, Dictionary<AnyHashable, Any>, SignalMulti<Dictionary<AnyHashable, Any>>>') to type '(SignalInput<DocumentValues.Tuple>, SignalMulti<DocumentValues.Dict>)' (aka '(SignalInput<(AnyHashable, Optional<Any>)>, SignalMulti<Dictionary<AnyHashable, Any>>)')
                }.continuous(initialValue: [:])
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`

4. Advanced behaviors - Capturing

`error: CwlSignal.playground:12:45: error: expression type 'SignalChannel<Int, SignalInput<Int>, Int, SignalMulti<Int>>' is ambiguous without more context
let (input, output) = Signal<Int>.channel().continuous()
                      ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~`

5. Parallel composition - merging

`error: CwlSignal.playground:57:16: error: cannot invoke initializer for type 'SignalChannel<_, SignalInput<_>, _, Signal<_>>' with an argument list of type '((input: SignalMergedInput<String>, signal: Signal<String>))'
let mergeSet = SignalChannel(Signal<String>.createMergedInput()).subscribeValuesUntilEnd {
               ^

CwlSignal.playground:57:16: note: overloads for 'SignalChannel<_, SignalInput<_>, _, Signal<_>>' exist with these partially matching parameter lists: (input: Input, signal: Output), ()
let mergeSet = SignalChannel(Signal<String>.createMergedInput()).subscribeValuesUntilEnd {
               ^

error: CwlSignal.playground:38:18: error: use of unresolved identifier 'MultiChannel'
let multiInput = MultiChannel<String>().subscribeValuesUntilEnd {
                 ^~~~~~~~~~~~`
mattgallagher commented 6 years ago

All of these errors are due to SignalChannel which has been in flux for the last couple months (trying to get a good design that handles all expected scenarios is proving a little tricky).

In any case, I've fixed the issues and it should all work again.

chh51 commented 6 years ago

Thanks, all the playground examples worked on my machine.