Change signature of &on_change handler

After thinking about this for quite a while (and starting
implementation) - for now I think it is much easier to not allow the
table &on_change handler to change the result of a change - but to only
be notified that a change happened.

I might re-think this lateron - the reasoning is that this makes
development easier, and that I am not quite sure about potential
side-effects for things that assume that a table change does take
effect.
This commit is contained in:
Johanna Amann 2020-01-13 13:32:24 -08:00
parent 68167d14aa
commit 5b5d36cd83

View file

@ -497,9 +497,9 @@ void Attributes::CheckAttr(Attr* a)
const FuncType *c_ft = change_func->Type()->AsFuncType();
if ( c_ft->YieldType()->Tag() != TYPE_BOOL )
if ( c_ft->YieldType()->Tag() != TYPE_VOID )
{
Error("&on_change must yield a value of type bool");
Error("&on_change must not return a value");
break;
}