sylefeb / Silice

Silice is an easy-to-learn, powerful hardware description language, that simplifies designing hardware algorithms with parallelism and pipelines.
Other
1.28k stars 77 forks source link

Name shadowing #250

Open sylefeb opened 1 year ago

sylefeb commented 1 year ago

Variable name shadowing currently produces an error (draft), however a strong warning may be better as there are situations where this acceptable (see e.g. https://github.com/sylefeb/Silice/issues/108#issuecomment-1484947541).

Overall name shadowing needs a complete pass to clarify and revise cases of name collisions (unit/subroutine/algorithm/variable/circuitry/instances).

Only clear error cases should trigger an error, e.g.:

int a = 0;
int a = 5; // this cannot be good

In such cases, the internal variable name truly collides anyway...