Fix a compiler error when using T.totalSerializedFields
This commit is contained in:
parent
94224f6e18
commit
65184697ff
|
@ -27,7 +27,7 @@ proc encodeImpl(writer: var auto, value: auto) =
|
||||||
writer.writeValue value
|
writer.writeValue value
|
||||||
|
|
||||||
template encode*(Format: type, value: auto, params: varargs[untyped]): auto =
|
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)]
|
var s = init MemoryOutputStream[PreferedOutputType(Format)]
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
|
|
|
@ -28,7 +28,7 @@ proc totalSerializedFieldsImpl(T: type): int =
|
||||||
|
|
||||||
proc helper: int =
|
proc helper: int =
|
||||||
var dummy: T
|
var dummy: T
|
||||||
template countFields(x) = inc result
|
template countFields(k, v) = inc result
|
||||||
eachSerializedFieldImpl(dummy, countFields)
|
eachSerializedFieldImpl(dummy, countFields)
|
||||||
|
|
||||||
const res = helper()
|
const res = helper()
|
||||||
|
|
Loading…
Reference in New Issue