Skip to content

Commit 49c65a3

Browse files
authored
Remove redundant constraints. (#535)
1 parent a54815f commit 49c65a3

File tree

6 files changed

+38
-29
lines changed

6 files changed

+38
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ profile
1818
PlaygroundUtility.remap
1919
*.xctimeline
2020
*.xcscmblueprint
21+
*.o
2122

2223
# SwiftPM
2324
.build

Sources/Observer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension Signal {
4040
/// - disposable: The disposable to be disposed of when the `TransformerCore`
4141
/// yields any terminal event. If `observer` is a `Signal` input
4242
/// observer, this can be omitted.
43-
internal init<U, E: Swift.Error>(
43+
internal init<U, E>(
4444
_ observer: Signal<U, E>.Observer,
4545
_ transform: @escaping Event.Transformation<U, E>,
4646
_ disposable: Disposable? = nil

Sources/Property.swift

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import enum Result.NoError
99
///
1010
/// Only classes can conform to this protocol, because having a signal
1111
/// for changes over time implies the origin must have a unique identity.
12-
public protocol PropertyProtocol: class, BindingSource {
13-
associatedtype Value
14-
12+
public protocol PropertyProtocol: class, BindingSource where Error == NoError {
1513
/// The current value of the property.
1614
var value: Value { get }
1715

@@ -92,7 +90,7 @@ extension PropertyProtocol {
9290
}
9391
}
9492

95-
extension PropertyProtocol where Error == NoError {
93+
extension PropertyProtocol {
9694
/// Maps the current value and all subsequent values to a new property.
9795
///
9896
/// - parameters:
@@ -125,7 +123,7 @@ extension PropertyProtocol where Error == NoError {
125123
///
126124
/// - returns: A property that holds a tuple containing values of `self` and
127125
/// the given property.
128-
public func combineLatest<P: PropertyProtocol>(with other: P) -> Property<(Value, P.Value)> where P.Error == NoError {
126+
public func combineLatest<P: PropertyProtocol>(with other: P) -> Property<(Value, P.Value)> {
129127
return Property.combineLatest(self, other)
130128
}
131129

@@ -137,7 +135,7 @@ extension PropertyProtocol where Error == NoError {
137135
///
138136
/// - returns: A property that holds a tuple containing values of `self` and
139137
/// the given property.
140-
public func zip<P: PropertyProtocol>(with other: P) -> Property<(Value, P.Value)> where P.Error == NoError {
138+
public func zip<P: PropertyProtocol>(with other: P) -> Property<(Value, P.Value)> {
141139
return Property.zip(self, other)
142140
}
143141

@@ -241,55 +239,55 @@ extension PropertyProtocol where Value: Hashable {
241239
extension PropertyProtocol {
242240
/// Combines the values of all the given properties, in the manner described
243241
/// by `combineLatest(with:)`.
244-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol>(_ a: A, _ b: B) -> Property<(A.Value, B.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error {
242+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol>(_ a: A, _ b: B) -> Property<(A.Value, B.Value)> where A.Value == Value {
245243
return a.lift { SignalProducer.combineLatest($0, b) }
246244
}
247245

248246
/// Combines the values of all the given properties, in the manner described
249247
/// by `combineLatest(with:)`.
250-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol>(_ a: A, _ b: B, _ c: C) -> Property<(Value, B.Value, C.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error {
248+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol>(_ a: A, _ b: B, _ c: C) -> Property<(Value, B.Value, C.Value)> where A.Value == Value {
251249
return a.lift { SignalProducer.combineLatest($0, b, c) }
252250
}
253251

254252
/// Combines the values of all the given properties, in the manner described
255253
/// by `combineLatest(with:)`.
256-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(Value, B.Value, C.Value, D.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error {
254+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(Value, B.Value, C.Value, D.Value)> where A.Value == Value {
257255
return a.lift { SignalProducer.combineLatest($0, b, c, d) }
258256
}
259257

260258
/// Combines the values of all the given properties, in the manner described
261259
/// by `combineLatest(with:)`.
262-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(Value, B.Value, C.Value, D.Value, E.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error {
260+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(Value, B.Value, C.Value, D.Value, E.Value)> where A.Value == Value {
263261
return a.lift { SignalProducer.combineLatest($0, b, c, d, e) }
264262
}
265263

266264
/// Combines the values of all the given properties, in the manner described
267265
/// by `combineLatest(with:)`.
268-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error {
266+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where A.Value == Value {
269267
return a.lift { SignalProducer.combineLatest($0, b, c, d, e, f) }
270268
}
271269

272270
/// Combines the values of all the given properties, in the manner described
273271
/// by `combineLatest(with:)`.
274-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error {
272+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where A.Value == Value {
275273
return a.lift { SignalProducer.combineLatest($0, b, c, d, e, f, g) }
276274
}
277275

278276
/// Combines the values of all the given properties, in the manner described
279277
/// by `combineLatest(with:)`.
280-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error, A.Error == H.Error {
278+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where A.Value == Value {
281279
return a.lift { SignalProducer.combineLatest($0, b, c, d, e, f, g, h) }
282280
}
283281

284282
/// Combines the values of all the given properties, in the manner described
285283
/// by `combineLatest(with:)`.
286-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error, A.Error == H.Error, A.Error == I.Error {
284+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where A.Value == Value {
287285
return a.lift { SignalProducer.combineLatest($0, b, c, d, e, f, g, h, i) }
288286
}
289287

290288
/// Combines the values of all the given properties, in the manner described
291289
/// by `combineLatest(with:)`.
292-
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol, J: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error, A.Error == H.Error, A.Error == I.Error, A.Error == J.Error {
290+
public static func combineLatest<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol, J: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where A.Value == Value {
293291
return a.lift { SignalProducer.combineLatest($0, b, c, d, e, f, g, h, i, j) }
294292
}
295293

@@ -306,55 +304,55 @@ extension PropertyProtocol {
306304

307305
/// Zips the values of all the given properties, in the manner described by
308306
/// `zip(with:)`.
309-
public static func zip<A: PropertyProtocol, B: PropertyProtocol>(_ a: A, _ b: B) -> Property<(Value, B.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error {
307+
public static func zip<A: PropertyProtocol, B: PropertyProtocol>(_ a: A, _ b: B) -> Property<(Value, B.Value)> where A.Value == Value {
310308
return a.lift { SignalProducer.zip($0, b) }
311309
}
312310

313311
/// Zips the values of all the given properties, in the manner described by
314312
/// `zip(with:)`.
315-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol>(_ a: A, _ b: B, _ c: C) -> Property<(Value, B.Value, C.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error {
313+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol>(_ a: A, _ b: B, _ c: C) -> Property<(Value, B.Value, C.Value)> where A.Value == Value {
316314
return a.lift { SignalProducer.zip($0, b, c) }
317315
}
318316

319317
/// Zips the values of all the given properties, in the manner described by
320318
/// `zip(with:)`.
321-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(Value, B.Value, C.Value, D.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error {
319+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(Value, B.Value, C.Value, D.Value)> where A.Value == Value {
322320
return a.lift { SignalProducer.zip($0, b, c, d) }
323321
}
324322

325323
/// Zips the values of all the given properties, in the manner described by
326324
/// `zip(with:)`.
327-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(Value, B.Value, C.Value, D.Value, E.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error {
325+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(Value, B.Value, C.Value, D.Value, E.Value)> where A.Value == Value {
328326
return a.lift { SignalProducer.zip($0, b, c, d, e) }
329327
}
330328

331329
/// Zips the values of all the given properties, in the manner described by
332330
/// `zip(with:)`.
333-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error {
331+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where A.Value == Value {
334332
return a.lift { SignalProducer.zip($0, b, c, d, e, f) }
335333
}
336334

337335
/// Zips the values of all the given properties, in the manner described by
338336
/// `zip(with:)`.
339-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error {
337+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where A.Value == Value {
340338
return a.lift { SignalProducer.zip($0, b, c, d, e, f, g) }
341339
}
342340

343341
/// Zips the values of all the given properties, in the manner described by
344342
/// `zip(with:)`.
345-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error, A.Error == H.Error {
343+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where A.Value == Value {
346344
return a.lift { SignalProducer.zip($0, b, c, d, e, f, g, h) }
347345
}
348346

349347
/// Zips the values of all the given properties, in the manner described by
350348
/// `zip(with:)`.
351-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error, A.Error == H.Error, A.Error == I.Error {
349+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where A.Value == Value {
352350
return a.lift { SignalProducer.zip($0, b, c, d, e, f, g, h, i) }
353351
}
354352

355353
/// Zips the values of all the given properties, in the manner described by
356354
/// `zip(with:)`.
357-
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol, J: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where A.Value == Value, A.Error == NoError, A.Error == B.Error, A.Error == C.Error, A.Error == D.Error, A.Error == E.Error, A.Error == F.Error, A.Error == G.Error, A.Error == H.Error, A.Error == I.Error, A.Error == J.Error {
355+
public static func zip<A: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol, J: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where A.Value == Value {
358356
return a.lift { SignalProducer.zip($0, b, c, d, e, f, g, h, i, j) }
359357
}
360358

Sources/Scheduler.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,17 @@ public final class QueueScheduler: DateScheduler {
326326
flags: DispatchSource.TimerFlags(rawValue: UInt(0)),
327327
queue: queue
328328
)
329+
330+
#if swift(>=4.0)
331+
timer.schedule(wallDeadline: wallTime(with: date),
332+
repeating: interval,
333+
leeway: leeway)
334+
#else
329335
timer.scheduleRepeating(wallDeadline: wallTime(with: date),
330336
interval: interval,
331337
leeway: leeway)
338+
#endif
339+
332340
timer.setEventHandler(handler: action)
333341
timer.resume()
334342

Sources/Signal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ extension Signal {
18561856
}
18571857
}
18581858

1859-
private convenience init<Strategy: SignalAggregateStrategy>(_ builder: AggregateBuilder<Strategy>, _ transform: @escaping (ContiguousArray<Any>) -> Value) {
1859+
private convenience init<Strategy>(_ builder: AggregateBuilder<Strategy>, _ transform: @escaping (ContiguousArray<Any>) -> Value) {
18601860
self.init { observer in
18611861
let disposables = CompositeDisposable()
18621862
let strategy = Strategy(count: builder.startHandlers.count) { event in

Sources/UnidirectionalBinding.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ precedencegroup BindingPrecedence {
1111

1212
infix operator <~ : BindingPrecedence
1313

14-
// FIXME: Swift 4 - associated type arbitrary requirements
14+
// FIXME: Swift 4.x - Conditional Conformance
1515
// public protocol BindingSource: SignalProducerConvertible where Error == NoError {}
16+
// extension Signal: BindingSource where Error == NoError {}
17+
// extension SignalProducer: BindingSource where Error == NoError {}
1618

1719
/// Describes a source which can be bound.
1820
public protocol BindingSource: SignalProducerConvertible {
1921
// FIXME: Swift 4 compiler regression.
2022
// All requirements are replicated to workaround the type checker issue.
2123
// https://bugs.swift.org/browse/SR-5090
22-
2324
associatedtype Value
24-
associatedtype Error
25+
associatedtype Error: Swift.Error
2526

2627
var producer: SignalProducer<Value, Error> { get }
2728
}
29+
2830
extension Signal: BindingSource {}
2931
extension SignalProducer: BindingSource {}
3032

0 commit comments

Comments
 (0)