Merge remote-tracking branch 'origin/topic/robin/gh-467-addto'

- In this merge commit: fixed parentheses/typo that breaks compilation

* origin/topic/robin/gh-467-addto:
  Catch if &add_func/&delete_func is applied to IDs that don't have values.
This commit is contained in:
Jon Siwek 2020-08-18 12:10:26 -07:00
commit 3fc86a39b8
5 changed files with 32 additions and 1 deletions

View file

@ -220,6 +220,13 @@ void ID::SetVal(ExprPtr ev, InitClass c)
if ( ! a )
Internal("no add/delete function in ID::SetVal");
if ( ! val )
{
Error(fmt("%s initializer applied to ID without value",
c == INIT_EXTRA ? "+=" : "-="), this);
return;
}
EvalFunc(a->GetExpr(), std::move(ev));
}