Test class with multiple extend (#4504)

Adds coverage for an existing diagnostic. Code appears to work without
modification.

---------

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2024-11-08 16:29:53 +00:00
committed by GitHub
co-authored by Josh L
parent cab7818df8
commit bbeb66b5fe
4 changed files with 941 additions and 6 deletions
-3
View File
@@ -493,9 +493,6 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id,
// If this is our second lookup result, diagnose an ambiguity.
if (result.inst_id.is_valid()) {
// TODO: This is currently not reachable because the only scope that can
// extend is a class scope, and it can only extend a single base class.
// Add test coverage once this is possible.
CARBON_DIAGNOSTIC(
NameAmbiguousDueToExtend, Error,
"ambiguous use of name `{0}` found in multiple extended scopes",