SD0112
On this page

SD0112

Core code

a local name is declared twice in one function

No "use typeshade" program on this site raises this code, so the page has no example. The fn() builder builds the IR directly and reaches the check at the lines under Source.

The registry text and every compiler message on these pages are the compiler's own English.

When it fires

The optimizer's per-function maps are keyed on a binding's name alone, so a duplicate name merges two bindings. Reported per violation by the no-shadowed-local rule (core, so at every emit on both writers) and thrown by fixpoint, which additionally covers a direct optimizeAt() caller and the post-lowering module the rule never sees.

How to fix it

The registry's hint: rename one of the two bindings, or omit the name (b.let(value) / b.var(type)) to take a function-unique auto name — the optimizer keys its per-function maps on the name alone, so two bindings sharing one name collapse into one

See also

Source

Where the compiler raises this code at commit 26de7be8, one line per file:

Edit this page Report a problem