summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-10-18 22:44:13 +0800
committerGitHub <noreply@github.com>2023-10-18 22:44:13 +0800
commit0d4b3ed18edff5ae098be842a986cb32de651fbf (patch)
tree7d2cf8c9ff4ab7b0c704263ea983bb9c240c67b7
parent3c48af7ebe9c8949ce3341bb62eacf0de43e4d11 (diff)
downloadNim-0d4b3ed18edff5ae098be842a986cb32de651fbf.tar.gz
fixes #22836; Unnecessary warning on 'options.none' with 'strictDefs'… (#22837)
… enabled

fixes #22836
-rw-r--r--lib/pure/options.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/options.nim b/lib/pure/options.nim
index ec384ceb4..815eaab89 100644
--- a/lib/pure/options.nim
+++ b/lib/pure/options.nim
@@ -152,7 +152,7 @@ proc none*(T: typedesc): Option[T] {.inline.} =
     assert none(int).isNone
 
   # the default is the none type
-  discard
+  result = Option[T]()
 
 proc none*[T]: Option[T] {.inline.} =
   ## Alias for `none(T) <#none,typedesc>`_.