mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 18:25:49 +01:00
Produce a more descriptive error if an array type's bound is too large. (#3638)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user