add `{.raises.}` annotation to `writeValue` (#88)

Tag `writeValue` override with `{.raises: [IOError].}`.
This commit is contained in:
Etan Kissling 2023-08-19 18:31:42 +02:00 committed by GitHub
parent 3c7c1cfc76
commit d784b823be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@ proc init*(T: type WinregWriter,
result.hKey = hKey
result.path = path
proc writeValue*(w: var WinregWriter, value: auto) =
proc writeValue*(w: var WinregWriter, value: auto) {.raises: [IOError].} =
mixin enumInstanceSerializedFields, writeValue, writeFieldIMPL
# TODO: reduce allocation

View File

@ -47,7 +47,8 @@ type
proc readValue(r: var WinregReader, value: var ValidIpAddress) =
r.readValue(value.value)
proc writeValue(w: var WinregWriter, value: ValidIpAddress) =
proc writeValue(
w: var WinregWriter, value: ValidIpAddress) {.raises: [IOError].} =
w.writeValue(value.value)
suite "optional fields test suite":