mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 02:03:59 +00:00
* fixes #19967 * use case * add testcase * fix typos * explictly specify other branches Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
This commit is contained in:
@@ -74,3 +74,30 @@ template main =
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
# bug #19967
|
||||
block:
|
||||
type
|
||||
X = object
|
||||
a: string
|
||||
b: set[char]
|
||||
|
||||
var y = X(b: {'a'})
|
||||
|
||||
reset(y)
|
||||
|
||||
doAssert y.b == {}
|
||||
|
||||
block:
|
||||
type
|
||||
Color = enum
|
||||
Red, Blue, Yellow
|
||||
X = object
|
||||
a: string
|
||||
b: set[Color]
|
||||
|
||||
var y = X(b: {Red, Blue})
|
||||
|
||||
reset(y)
|
||||
doAssert y.b == {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user