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

bug(semantic): "nested" references aren't tracked in symbol references #660

Closed
2 tasks
DonIsaac opened this issue Jul 30, 2023 · 0 comments
Closed
2 tasks
Assignees
Labels
A-ast Area - AST A-semantic Area - Semantic C-bug Category - Bug

Comments

@DonIsaac
Copy link
Contributor

DonIsaac commented Jul 30, 2023

Consider the following code snippets:

let a = 1; b;
b = a++;
// ...
let a = 1, b;
b = (0, ++a);

After semantic analysis in both cases, a will be considered to have a single reference of type ReferenceFlags::Write. In fact, since ReferenceFlags is an enum, it's impossible for a symbol reference to be both a read and a write.

  • ReferenceFlags should be a bitflag
  • When encountering an IdentifierReference, SemanticBuilder should walk up the AST on certain nodes (e.g. UpdateExpressions) and check for further reads/writes
@DonIsaac DonIsaac added C-bug Category - Bug A-semantic Area - Semantic A-ast Area - AST labels Jul 30, 2023
@DonIsaac DonIsaac self-assigned this Jul 30, 2023
Boshen pushed a commit that referenced this issue Jul 31, 2023
@DonIsaac DonIsaac closed this as completed Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ast Area - AST A-semantic Area - Semantic C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

1 participant