> "template-local symbol mishandled when shadowing a sub-proc-scope inject" or
> something similar.
That's a lot more concise than my title for the bug ... but the thing is, the
local symbol _doesn 't_ shadow the one in the proc (or v.v. -- symbols in inner
scopes shadow symbols in outer scopes) -- the proc is declared first! (And
changing the order, moving the let above the proc, doesn't change anything.)
That's why I think it has something to do with popping the symbol table entry
for the x in the proc somehow pops it for the x in the template. Anyway, I'll
leave it up to the compiler people to figure out ... if they ever do; it's
certainly lo pri, since the workaround is so simple. But it's a weird one.
Hmm ... following the above assumption, I got rid of the bod call (among other
simplifications) and it still fails ... any use of a locally declared x
apparently fails:
template t =
proc p =
let x {.inject.} = 1
let x = 1
x
t
Run