mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Look outside constant values for designators in where constraints (#7367)
The constant value may lose the designator during eval, such as an `ImplWitnessAccess` that resolves to some concrete type. Look in the non-canonical instructions instead.
This commit is contained in:
@@ -81,8 +81,8 @@ auto PopNameComponent(Context& context, SemIR::InstId return_pattern_id)
|
||||
|
||||
// Pop the name of a declaration from the node stack, and diagnose if it has
|
||||
// parameters.
|
||||
auto PopNameComponentWithoutParams(Context& context, Lex::TokenKind introducer)
|
||||
-> NameComponent {
|
||||
auto PopNameComponentWithoutParams(Context& context, Lex::TokenKind introducer,
|
||||
bool* diagnosed_params) -> NameComponent {
|
||||
NameComponent name = PopNameComponent(context);
|
||||
if (name.call_params_id.has_value()) {
|
||||
CARBON_DIAGNOSTIC(UnexpectedDeclNameParams, Error,
|
||||
@@ -95,6 +95,9 @@ auto PopNameComponentWithoutParams(Context& context, Lex::TokenKind introducer)
|
||||
UnexpectedDeclNameParams, introducer);
|
||||
|
||||
name.call_params_id = SemIR::InstBlockId::None;
|
||||
if (diagnosed_params) {
|
||||
*diagnosed_params = true;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user