mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-26 14:20:05 +00:00
show error message for inhomogenous array
This commit is contained in:
parent
3055645323
commit
247bcb0714
@ -868,6 +868,13 @@ parse_array(location<Container>& loc)
|
||||
|
||||
if(auto val = parse_value(loc))
|
||||
{
|
||||
if(!retval.empty() && retval.front().type() != val.as_ok().type())
|
||||
{
|
||||
throw syntax_error(format_underline(
|
||||
"[error] toml::parse_array: type of elements should be the "
|
||||
"same each other.", region<Container>(loc, first, loc.iter()),
|
||||
"inhomogenous types"));
|
||||
}
|
||||
retval.push_back(std::move(val.unwrap()));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user