diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-08-24 00:38:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 18:38:12 +0200 |
commit | e8556b45f58b3b231c3720189bad9a4eeb6ca51f (patch) | |
tree | 335c498d952ef40b01fb40a5b79976264fbb3b9a /tests | |
parent | 32e4b3363225a7bba39886b2dae09c9576a7f221 (diff) | |
download | Nim-e8556b45f58b3b231c3720189bad9a4eeb6ca51f.tar.gz |
fixes #19967; reset does not work on set [backport: 1.2] (#19968)
* fixes #19967 * use case * add testcase * fix typos * explictly specify other branches Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/tsystem.nim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/stdlib/tsystem.nim b/tests/stdlib/tsystem.nim index 00be16275..a90a1d1d9 100644 --- a/tests/stdlib/tsystem.nim +++ b/tests/stdlib/tsystem.nim @@ -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 == {} + |