From 674c9e4c8e0cad2b7193cc9a59c12d39a397750f Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sun, 20 Aug 2023 12:40:32 +0200 Subject: [PATCH] explicitly initialize `result` (#89) 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 76f03b3..a4104df 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))