diff --git a/libp2p/errors.nim b/libp2p/errors.nim index 3b6f3ed40..e7da7094d 100644 --- a/libp2p/errors.nim +++ b/libp2p/errors.nim @@ -19,7 +19,8 @@ func toException*(e: string): ref LPError = # sadly nim needs more love for hygienic templates # so here goes the macro, its based on the proc/template version # and uses quote do so it's quite readable -macro checkFutures*[T](futs: seq[Future[T]], exclude: untyped = []): untyped = +# TODO https://github.com/nim-lang/Nim/issues/22936 +macro checkFutures*[F](futs: seq[F], exclude: untyped = []): untyped = let nexclude = exclude.len case nexclude of 0: diff --git a/libp2p/transports/tcptransport.nim b/libp2p/transports/tcptransport.nim index 18dd235fe..388ab6a43 100644 --- a/libp2p/transports/tcptransport.nim +++ b/libp2p/transports/tcptransport.nim @@ -219,7 +219,7 @@ method accept*(self: TcpTransport): Future[Connection] {.async, gcsafe.} = try: if self.acceptFuts.len <= 0: - self.acceptFuts = self.servers.mapIt(it.accept()) + self.acceptFuts = self.servers.mapIt(Future[StreamTransport](it.accept())) if self.acceptFuts.len <= 0: return