Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent symbol overriding by another type #19

Closed
antis81 opened this issue Apr 28, 2021 · 1 comment
Closed

prevent symbol overriding by another type #19

antis81 opened this issue Apr 28, 2021 · 1 comment

Comments

@antis81
Copy link
Contributor

antis81 commented Apr 28, 2021

After the merge of #18 I noticed that doesn't handle a (rather important) corner case…

The following test shows this is not handled by the parser yet:

symbol_0  ; label
;!error <TBD>
symbol_0  = "overrides symbol_0 (changing type from label to var)"

On the other hand re-assigning a var is fine:

symbol_1 = 1233
symbol_1 = symbol_1 + 1  ; re-assigning is good :)

This can be handled with the "final" flag and basically relies on the "const" definition of a label type.

Note this only applies to assignment types as other symbols (macro, enum, section, … ) are named "anonymously" - thus clearly distinguish from each other.

@sasq64
Copy link
Owner

sasq64 commented May 6, 2023

Testing now, and the second case actually fails.

The first case gives a data type error, which I think is OK, you shouldn't change types of
variables.

Opening #37 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants