From 06438ed1431ee8ad3ae2eda9dcb7fbe64739329a Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 29 Mar 2020 20:49:13 +0300 Subject: Close https://github.com/nim-lang/Nim/issues/11428 --- tests/constructors/tinvalid_construction.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/constructors') diff --git a/tests/constructors/tinvalid_construction.nim b/tests/constructors/tinvalid_construction.nim index e6fdbcb85..c17e2123c 100644 --- a/tests/constructors/tinvalid_construction.nim +++ b/tests/constructors/tinvalid_construction.nim @@ -256,3 +256,15 @@ reject TNestedChoices(outerChoice: false, innerChoice: C) accept TNestedChoices(outerChoice: false, innerChoice: C, notnil: notNilRef) reject TNestedChoices(outerChoice: false, innerChoice: C, notnil: nil) +block: + # https://github.com/nim-lang/Nim/issues/11428 + type + Enum = enum A, B, C + Thing = object + case kind: Enum + of A: discard + of B: s: string + of C: r: range[1..1] # DateTime + + # Fine to not initialize 'r' because this is implicitly initialized and known to be branch 'A'. + let someThing = Thing() -- cgit 1.4.1-2-gfad0