mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-26 17:24:02 +00:00
range/case fixes (#11264)
This commit is contained in:
committed by
Andreas Rumpf
parent
e26545797e
commit
90ed904c4d
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)
|
||||
Reference in New Issue
Block a user