Fix the build on Nim 1.6 (which doesn't allow derefencing nil)

This commit is contained in:
Zahary Karadjov 2022-06-19 13:03:04 +03:00
parent 90276771dc
commit 1d33fa3ced
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609

View File

@ -180,7 +180,7 @@ macro customSerialization*(field: untyped, definition): untyped =
discard
template GetFieldType(FT: type FieldTag): type =
typeof(field(cast[ptr FT.RecordType](nil)[], FT.fieldName))
typeof field(declval(FT.RecordType), FT.fieldName)
template readFieldIMPL[Reader](field: type FieldTag,
reader: var Reader): untyped =