mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user