mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-26 23:11:19 +00:00
Basic name poisoning support (#4654)
https://github.com/carbon-language/carbon-lang/issues/4622 When using an unqualified name, disallow declaring that name in all scopes that would make it ambiguous in retrospect. Doesn't include support for poisoning in `impl library` (see new test for that with TODO). Implemented by introduce `InstId::PoisonedName` and entries with it to `NameScope`. --------- Co-authored-by: Dana Jansens <danakj@orodu.net> Co-authored-by: Richard Smith <richard@metafoo.co.uk> Co-authored-by: Geoff Romer <gromer@google.com> Co-authored-by: Jon Ross-Perkins <jperkins@google.com> Co-authored-by: josh11b <josh11b@users.noreply.github.com> Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com> Co-authored-by: Chandler Carruth <chandlerc@gmail.com> Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
This commit is contained in:
20 files changed
+1006
-100
No files matched your search
@@ -123,6 +123,11 @@ static auto TryMergeRedecl(Context& context, Parse::AnyFunctionDeclId node_id,
|
||||
return;
|
||||
}
|
||||
|
||||
if (prev_id.is_poisoned()) {
|
||||
context.DiagnosePoisonedName(function_info.latest_decl_id());
|
||||
return;
|
||||
}
|
||||
|
||||
auto prev_function_id = SemIR::FunctionId::Invalid;
|
||||
auto prev_import_ir_id = SemIR::ImportIRId::Invalid;
|
||||
CARBON_KIND_SWITCH(context.insts().Get(prev_id)) {
|
||||
|
||||
Reference in new issue
Block a user