Produce a more descriptive error if an array type's bound is too large. (#3638)

This commit is contained in:
Richard Smith
2024-01-23 21:01:34 +00:00
committed by GitHub
parent 65e95942de
commit 099bd5ce26
4 changed files with 43 additions and 23 deletions
+1 -2
View File
@@ -41,8 +41,7 @@ auto HandleArrayExpr(Context& context, Parse::ArrayExprId parse_node) -> bool {
if (!bound_inst.is_constant()) {
CARBON_DIAGNOSTIC(InvalidArrayExpr, Error,
"Array bound is not a constant.");
context.emitter().Emit(context.insts().GetParseNode(bound_inst_id),
InvalidArrayExpr);
context.emitter().Emit(bound_inst_id, InvalidArrayExpr);
context.node_stack().Push(parse_node, SemIR::InstId::BuiltinError);
return true;
}