diff --git a/Sources/Future/Future.swift b/Sources/Future/Future.swift index 178c489..0e941a4 100644 --- a/Sources/Future/Future.swift +++ b/Sources/Future/Future.swift @@ -22,8 +22,6 @@ import ExecutionContext public protocol FutureProtocol : MovableExecutionContextTenantProtocol { associatedtype Value - //Can not workaround as a protocol, because protocol can't set itself as a requirement - typealias SettledTenant = Future init(value:Value) init(error:Error) diff --git a/Sources/Future/Signal.swift b/Sources/Future/Signal.swift index 8620861..25db6b7 100644 --- a/Sources/Future/Signal.swift +++ b/Sources/Future/Signal.swift @@ -21,7 +21,7 @@ import Result import Event public extension SignalStream { - public func flatMap(_ f:@escaping (Payload)->F) -> SignalStream> where F.Value == A { + public func flatMap(_ f:@escaping (Payload)->F) -> SignalStream> where F.Value == A, F.SettledTenant == Future { let context = self.context return SignalStream>(context: context, advise: { fun in self.chain { sig, payload in