diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-11-21 04:17:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-20 21:17:20 +0100 |
commit | 8c56e806ae6a9db9928340a4b87ba50f87a035a2 (patch) | |
tree | 42290ff6f3543f0b35b21360fc3243cb266c8275 /tests/assign | |
parent | 81c051364426fdfa4310da7692d1d99600e51d8b (diff) | |
download | Nim-8c56e806ae6a9db9928340a4b87ba50f87a035a2.tar.gz |
closes #12464; adds a test case (#22967)
closes #12464
Diffstat (limited to 'tests/assign')
-rw-r--r-- | tests/assign/tvariantasgn.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/assign/tvariantasgn.nim b/tests/assign/tvariantasgn.nim index 1c3deeae1..4c3c38ca5 100644 --- a/tests/assign/tvariantasgn.nim +++ b/tests/assign/tvariantasgn.nim @@ -24,3 +24,16 @@ s = TAny(kind: nkInt, intVal: 78) # s = nr # works nr = s # fails! echo "came here" + +block: # bug #12464 + type + Foo = object + case isFunc: bool + of false: nil + of true: + fun: proc(): int + + const i = Foo(isFunc: false) + + let j = i + doAssert not j.isFunc |