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

Name Poisoning #4622

Open
bricknerb opened this issue Dec 4, 2024 · 0 comments
Open

Name Poisoning #4622

bricknerb opened this issue Dec 4, 2024 · 0 comments

Comments

@bricknerb
Copy link
Contributor

bricknerb commented Dec 4, 2024

github-merge-queue bot pushed a commit that referenced this issue Dec 5, 2024
…4635)

This is a preparation change for introducing name poisoning
(#4622), which
would have broken this test.
bricknerb added a commit to bricknerb/carbon-lang that referenced this issue Dec 6, 2024
carbon-language#4622
When using an unqualified name disallow using that name in all scopes that would make it ambiguous in retrospect.
Doesn't include support for poisoning when importing (see new test for that with TODO).
Implemented by introduce InstId::PoisonedName and entries with it to NameScope.
github-merge-queue bot pushed a commit that referenced this issue Dec 6, 2024
This is a preparation change for adding name poisoning support
(#4622), which is
expected to require more elaborate logic around NameScope since a name
can be not defined yet, defined, or poisoned.

The API separates looking up a name from getting the full entry since we
have cases where the entries are invalidated between the time we're
looking for the name and when we access (and sometimes modify) the
entry.

This change has the following benefits:
* `names` and `name_map` are internal to `NameScope` and are guaranteed
to match.
* `extended_scopes` and `import_ir_scopes` can not be manipulated (only
new scopes can be added).
* `inst_id`, `name_id` and `parent_scope_id` are constants.
* `has_error` can only be mutated from false to true.

---------

Co-authored-by: jonmeow <[email protected]>
bricknerb added a commit to bricknerb/carbon-lang that referenced this issue Dec 9, 2024
carbon-language#4622
When using an unqualified name disallow using that name in all scopes that would make it ambiguous in retrospect.
Doesn't include support for poisoning when importing (see new test for that with TODO).
Implemented by introduce `InstId::PoisonedName` and entries with it to `NameScope`.
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

1 participant