Tuple desctructuring does not work with underscores if used outside of var section. Inside it it's OK, and that's confusing. It seems Nim sees _ as a special identifier that should be declared.
Example
var x = 0
(x, _) = (1, 2)
Current Output
Error: undeclared identifier: '_'
Expected Output
To work the same way as
(This was fixed at some stage, e.g. bug #2421)
Possible Solution
Additional Information
Checked with Nim 1.4 and Nim 1.5 devel.
Tuple desctructuring does not work with underscores if used outside of
varsection. Inside it it's OK, and that's confusing. It seems Nim sees_as a special identifier that should be declared.Example
Current Output
Error: undeclared identifier: '_'Expected Output
To work the same way as
(This was fixed at some stage, e.g. bug #2421)
Possible Solution
Additional Information
Checked with Nim 1.4 and Nim 1.5 devel.