mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
This commit is contained in:
committed by
Andreas Rumpf
parent
4f3d309fb0
commit
06438ed143
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user