From 81e912facc365fe63ef0cec6df4c49001bbe99aa Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Thu, 17 Aug 2023 13:45:19 +0200 Subject: [PATCH] explicitly initialize `result` In Nim 2.0, `'result' requires explicit initialization`. Fix `makeDefaultValue` to do so. --- confutils.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confutils.nim b/confutils.nim index adca701..34bf706 100644 --- a/confutils.nim +++ b/confutils.nim @@ -629,7 +629,7 @@ template setField[T](loc: var seq[T], val: Option[string], defaultVal: untyped) loc = FieldType(defaultVal) func makeDefaultValue*(T: type): T = - discard + default(T) func requiresInput*(T: type): bool = not ((T is seq) or (T is Option) or (T is bool))