Skip to content

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

@DonIsaac

Description

@DonIsaac

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions