From 7b3c03d1fdde1357703fce61ac0953cf30a1844f Mon Sep 17 00:00:00 2001 From: vallode <18506096+vallode@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:23:28 +0100 Subject: [PATCH] Fix usage hint for _field method --- library/LuaTypes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/LuaTypes.cpp b/library/LuaTypes.cpp index 407dea265..cbf1779be 100644 --- a/library/LuaTypes.cpp +++ b/library/LuaTypes.cpp @@ -635,7 +635,7 @@ static int meta_struct_index(lua_State *state) static int meta_struct_field_reference(lua_State *state) { if (lua_gettop(state) != 2) - luaL_error(state, "Usage: object._field(name)"); + luaL_error(state, "Usage: object:_field(name)"); uint8_t *ptr = get_object_addr(state, 1, 2, "reference"); auto field = (struct_field_info*)find_field(state, 2, "reference"); if (!field) @@ -660,7 +660,7 @@ static int meta_struct_field_reference(lua_State *state) static int meta_global_field_reference(lua_State *state) { if (lua_gettop(state) != 2) - luaL_error(state, "Usage: object._field(name)"); + luaL_error(state, "Usage: object:_field(name)"); auto field = (struct_field_info*)find_field(state, 2, "reference"); if (!field) field_error(state, 2, "builtin property or method", "reference"); @@ -947,7 +947,7 @@ static int meta_container_index(lua_State *state) static int meta_container_field_reference(lua_State *state) { if (lua_gettop(state) != 2) - luaL_error(state, "Usage: object._field(index)"); + luaL_error(state, "Usage: object:_field(index)"); uint8_t *ptr = get_object_addr(state, 1, 2, "reference"); int iidx = lookup_container_field(state, 2, "reference");