another attempt to reduce compiler warnings
This commit is contained in:
parent
b7c085fc5c
commit
09b131c919
|
@ -23,13 +23,12 @@ template encode*(Format: type, value: auto, params: varargs[untyped]): auto =
|
||||||
raise (ref Defect)() # a memoryOutput cannot have an IOError
|
raise (ref Defect)() # a memoryOutput cannot have an IOError
|
||||||
|
|
||||||
# TODO Nim cannot make sense of this initialization by var param?
|
# TODO Nim cannot make sense of this initialization by var param?
|
||||||
{.push warning[ProveInit]: off.}
|
|
||||||
proc readValue*(reader: var auto, T: type): T =
|
proc readValue*(reader: var auto, T: type): T =
|
||||||
|
{.warning[ProveInit]: off.}
|
||||||
mixin readValue
|
mixin readValue
|
||||||
when (NimMajor, NimMinor) > (1, 6):
|
result = default(T)
|
||||||
result = default(T)
|
|
||||||
reader.readValue(result)
|
reader.readValue(result)
|
||||||
{.pop.}
|
{.warning[ProveInit]: on.}
|
||||||
|
|
||||||
template decode*(Format: distinct type,
|
template decode*(Format: distinct type,
|
||||||
input: string,
|
input: string,
|
||||||
|
|
|
@ -197,7 +197,10 @@ template readFieldIMPL[Reader](field: type FieldTag,
|
||||||
# additional notes: putting the FieldType coercion in
|
# additional notes: putting the FieldType coercion in
|
||||||
# `makeFieldReadersTable` will cause problems when orc enabled
|
# `makeFieldReadersTable` will cause problems when orc enabled
|
||||||
# hence, move it here
|
# hence, move it here
|
||||||
FieldType reader.readValue(FieldType)
|
when distinctBase(FieldType) isnot FieldType:
|
||||||
|
FieldType reader.readValue(FieldType)
|
||||||
|
else:
|
||||||
|
reader.readValue(FieldType)
|
||||||
|
|
||||||
template writeFieldIMPL*[Writer](writer: var Writer,
|
template writeFieldIMPL*[Writer](writer: var Writer,
|
||||||
fieldTag: type FieldTag,
|
fieldTag: type FieldTag,
|
||||||
|
|
Loading…
Reference in New Issue