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

This commit is contained in:
Richard Smith authored and GitHub committed 2024-01-23 21:01:34 +00:00
1 parent 65e95942de
commit 099bd5ce26
4 files changed
+43 -23

No files matched your search

+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;
}