added tests
This commit is contained in:
parent
6c20509121
commit
b34b1dbc6c
7 changed files with 172 additions and 0 deletions
24
tests/accept/run/tvariantasgn.nim
Normal file
24
tests/accept/run/tvariantasgn.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#BUG
|
||||
type
|
||||
TAnyKind = enum
|
||||
nkInt,
|
||||
nkFloat,
|
||||
nkString
|
||||
TAny = object
|
||||
case kind: TAnyKind
|
||||
of nkInt: intVal: int
|
||||
of nkFloat: floatVal: float
|
||||
of nkString: strVal: string
|
||||
|
||||
var s: TAny
|
||||
s.kind = nkString
|
||||
s.strVal = "test"
|
||||
|
||||
var nr: TAny
|
||||
nr.kind = nkint
|
||||
nr.intVal = 78
|
||||
|
||||
|
||||
# s = nr # works
|
||||
nr = s # fails!
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue