range/case fixes (#11264)
This commit is contained in:
parent
e26545797e
commit
90ed904c4d
4 changed files with 28 additions and 6 deletions
13
tests/objvariant/tfloatrangeobj.nim
Normal file
13
tests/objvariant/tfloatrangeobj.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
discard """
|
||||
output: '''(kind: 2.0, twoStr: "TWO STR")
|
||||
(kind: 1.0)
|
||||
'''
|
||||
"""
|
||||
type
|
||||
FloatRange = range[1.0..3.0]
|
||||
VariantObj = object
|
||||
case kind: FloatRange
|
||||
of 2.0: twoStr: string
|
||||
|
||||
echo VariantObj(kind: 2.0, twoStr: "TWO STR")
|
||||
echo VariantObj(kind: 1.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue