From 8c56e806ae6a9db9928340a4b87ba50f87a035a2 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Tue, 21 Nov 2023 04:17:20 +0800 Subject: closes #12464; adds a test case (#22967) closes #12464 --- tests/assign/tvariantasgn.nim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/assign') 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 -- cgit 1.4.1-2-gfad0