Improve &default validation for global vars: exclude sets

This commit is contained in:
Jon Siwek 2019-10-15 18:07:52 -07:00
parent 4c066ca914
commit 4bf3c6ff22
3 changed files with 7 additions and 6 deletions

View file

@ -288,9 +288,9 @@ void Attributes::CheckAttr(Attr* a)
{
// &default is allowed for global tables, since it's used in initialization
// of table fields. it's not allowed otherwise.
if ( global_var && ! type->IsSet() && type->Tag() != TYPE_TABLE )
if ( global_var && ! type->IsTable() )
{
Error("&default is not valid for global variables");
Error("&default is not valid for global variables except for tables");
break;
}