Commit a80f7a71 by Ian Lance Taylor

compiler: Better error for missing comma in composite literal.

From-SVN: r191795
parent e75d8ec9
......@@ -2723,7 +2723,11 @@ Parse::composite_lit(Type* type, int depth, Location location)
}
else
{
error_at(this->location(), "expected %<,%> or %<}%>");
if (token->is_op(OPERATOR_SEMICOLON))
error_at(this->location(),
"need trailing comma before newline in composite literal");
else
error_at(this->location(), "expected %<,%> or %<}%>");
this->gogo_->mark_locals_used();
int depth = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment