Skip to content

Commit

Permalink
Add missing error in json array coercion
Browse files Browse the repository at this point in the history
Resolves #729 on GitHub
  • Loading branch information
Dekker1 committed Sep 12, 2023
1 parent afe67ac commit da11a93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/json_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,11 @@ Expression* JSONParser::coerceArray(TypeInst* ti, ArrayLit* al) {
dims.emplace_back(1, nal->size());
} else {
if (nal->size() != dims[it.size() - 1].second) {
// TODO: Inconsistent array size.
throw JSONError(_env, Expression::loc(expr),
"Mismatch in array dimensions in JSON array literal: dimension " +
std::to_string(it.size()) + " was found with both length " +
std::to_string(dims[it.size() - 1].second) + " and length " +
std::to_string(nal->size()) + ".");
}
}
} else {
Expand Down

0 comments on commit da11a93

Please sign in to comment.