Fix a compiler error when using T.totalSerializedFields

This commit is contained in:
Zahary Karadjov 2018-12-28 03:01:24 +02:00
parent 94224f6e18
commit 65184697ff
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ proc encodeImpl(writer: var auto, value: auto) =
writer.writeValue value
template encode*(Format: type, value: auto, params: varargs[untyped]): auto =
mixin init, WriterType, PreferedOutputType # , writeValue, getOutput
mixin init, WriterType, PreferedOutputType
var s = init MemoryOutputStream[PreferedOutputType(Format)]
# TODO:

View File

@ -28,7 +28,7 @@ proc totalSerializedFieldsImpl(T: type): int =
proc helper: int =
var dummy: T
template countFields(x) = inc result
template countFields(k, v) = inc result
eachSerializedFieldImpl(dummy, countFields)
const res = helper()