From 26a5d8215089a4e7643c765377df46ff0db17821 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 10 Apr 2020 16:43:12 +0300 Subject: [PATCH] Work around a Nim bug --- faststreams/output_stream.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/faststreams/output_stream.nim b/faststreams/output_stream.nim index 3b75713..81b1137 100644 --- a/faststreams/output_stream.nim +++ b/faststreams/output_stream.nim @@ -379,7 +379,9 @@ proc append*(c: var WriteCursor, chars: openarray[char]) {.inline.} = template appendMemCopy*[T](c: var WriteCursor, value: T) = bind append - static: assert supportsCopyMem(T) + static: + type TT = T # TODO This deals with a Nim bug + assert supportsCopyMem(TT) let valueAddr = unsafeAddr value c.append makeOpenArray(cast[ptr byte](valueAddr), sizeof(value))