temporary work-around for a Nim bug

This commit is contained in:
Zahary Karadjov 2018-11-29 03:34:06 +02:00
parent 89a2105376
commit 36cf03f7a9
1 changed files with 4 additions and 1 deletions

View File

@ -12,8 +12,11 @@ template customSerialization* {.pragma.}
## TODO: deprecate this in favor of readField(T, field, InputArchive)
template eachSerializedFieldImpl*[T](x: T, op: untyped) =
when false:
static: echo treeRepr(T.getTypeImpl)
for k, v in fieldPairs(x):
when not hasCustomPragma(v, dontSerialize):
when true: # not hasCustomPragma(v, dontSerialize):
op(k, v)
proc totalSerializedFieldsImpl(T: type): int =