As per the documentation, I'm trying to "unpack" a tuple like this:
let (a, _) = getSomeTupleValue()
So, in that sense, I imagine I'm just assigning a to the first element of the tuple, and discard the second.
However, this is what I'm getting when compiling:
Hint: '_`gensym639' is declared but not used [XDeclaredButNotUsed]
How is that possible? Am I missing something?
You're not missing something. It looks like a bug. But I don't see it in 1.4.0:
let (a, _) = (1, 2)
echo 2
This hints about unused a and not about any other unused variable. If I echo a instead I get no hints.I was using 1.5.1 devel and thought I tried 1.4.0 to see if that was the case.
However, in 1.4.0, I keep getting the exact same message.
I still cannot figure out why I get the Hint and you don't. The only difference I guess would be that I'm using it in a template?
That sounds like a significant difference. The unittest.check macro manages to require parentheses that aren't normally required: https://github.com/nim-lang/Nim/issues/15618
I'd suggest getting a minimal example and creating an issue for it.