Redefinition of variable is not caught by compiler
LensPlaysGames opened this issue · 2 comments
; ERROR
a : integer
a : integer
The following test (included in repo at tst/tests/redef.un
) fails (as in, doesn't error even though it should). The only error comes from gcc
/as
complaining about multiple definition.
This bug was introduced when function overloading was, as symbols are no longer duplicate checked when being added to a scope, IIRC.
EDIT: 95a65ab
To fix this, we will have to do a pass on the AST during semantic analysis ensuring that each variable is only defined once, OR we could handle function symbols specially and add back in the functionality of checking duplicates, with the caveat of functions... It's a bit complex, but shouldn't be too hard to clear up.
This is currently broken due to redefinition checking still being disabled from when we started implementing overloading. Reenabling that should fix this.
Closing. Fixed with 7b490f7