Description
When case objects are nested, there is no way to access the inner fields without triggering ProveField (if enabled)
{.push warning[ProveField]:on.}
type Foo = object
case a: bool
of false:
discard
of true:
case b: bool
of false:
discard
of true:
c: bool
const f = Foo(a: true, b: true, c: true)
case f.a
of true:
case f.b
of true:
echo f.c
else: discard
else: discard
Nim Version
Nim Compiler Version 2.0.1 [MacOSX: amd64]
Compiled at 2023-10-03
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: d30565f810ba5165ea2e5bcd91ea3dee9950051f
active boot switches: -d:release
Current Output
/Users/etan/Documents/Repos/nimbus-eth2/test.nim(17, 9) Warning: cannot prove that field 'f.b' is accessible [ProveField]
case f.b
^
Expected Output
Possible Solution
No response
Additional Information
No response
Description
When
caseobjects are nested, there is no way to access the inner fields without triggeringProveField(if enabled){.push warning[ProveField]:on.} type Foo = object case a: bool of false: discard of true: case b: bool of false: discard of true: c: bool const f = Foo(a: true, b: true, c: true) case f.a of true: case f.b of true: echo f.c else: discard else: discardNim Version
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response