Skip to content

Commit

Permalink
closes nim-lang#12464; adds a test case (nim-lang#22967)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Nov 20, 2023
1 parent 81c0513 commit 8c56e80
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/assign/tvariantasgn.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c56e80

Please sign in to comment.