From d784b823be28532aadd77af5c983b6ba18cf33d8 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sat, 19 Aug 2023 18:31:42 +0200 Subject: [PATCH] add `{.raises.}` annotation to `writeValue` (#88) Tag `writeValue` override with `{.raises: [IOError].}`. --- confutils/winreg/writer.nim | 2 +- tests/test_winreg.nim | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/confutils/winreg/writer.nim b/confutils/winreg/writer.nim index 5c431d1..b21f833 100644 --- a/confutils/winreg/writer.nim +++ b/confutils/winreg/writer.nim @@ -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 diff --git a/tests/test_winreg.nim b/tests/test_winreg.nim index 8778cc2..4d39998 100644 --- a/tests/test_winreg.nim +++ b/tests/test_winreg.nim @@ -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":