Mark ref_target as a metafield so meta_primitive_newindex fails properly

unit:_field('hist_figure_id').ref_target = 4 now fails with "Cannot write field int32_t.ref_target: builtin property or method" instead of "not found"
develop
lethosor 2020-07-14 02:31:18 -04:00
parent a44a2e2298
commit df6f3a0455
1 changed files with 2 additions and 0 deletions

@ -1316,6 +1316,8 @@ static void MakePrimitiveMetatable(lua_State *state, type_identity *type)
{
EnableMetaField(state, base+2, "value", type);
AssociateId(state, base+3, 1, "value");
EnableMetaField(state, base+2, "ref_target", NULL);
}
// Add the iteration metamethods