adds a test case (#24466)

closes https://github.com/nim-lang/Nim/issues/23770 ref
https://github.com/nim-lang/Nim/pull/24442

(cherry picked from commit 9fcc3b0599)
This commit is contained in:
ringabout
2024-11-22 05:10:48 +08:00
committed by narimiran
parent aa8d62f89c
commit 1bc501f8ce

View File

@@ -789,5 +789,25 @@ template main {.dirty.} =
var a = SearchInfo()
a.evaluation()
block: # bug #23770
type
Enum = enum A, B
Object = object
case a: Enum
of A:
integer: int = 200
of B:
time: string
Simple = object
v = -1
Another = object
o = Object(a: A)
v: Simple
let s1 = Object(a: A)
let s2 = Another()
doAssert s1.integer == 200 and s2.o.integer == 200
static: main()
main()