Skip to content

Commit

Permalink
adds a test case (#24466)
Browse files Browse the repository at this point in the history
closes #23770 ref
#24442
  • Loading branch information
ringabout authored Nov 21, 2024
1 parent a788bae commit 9fcc3b0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/objects/tobject_default_value.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 9fcc3b0

Please sign in to comment.