Fix setting userdata (static) fields when it has __index metamethod/function.

Closes #312
This commit is contained in:
Alex Orlenko
2023-08-27 23:01:37 +01:00
parent fc159e0c46
commit 53b7b5b70b
2 changed files with 31 additions and 2 deletions
+1
View File
@@ -2667,6 +2667,7 @@ impl Lua {
rawset_field(state, metatable_index, "__index")?;
}
_ => {
ffi::lua_pop(state, 1);
// Propagate fields to the field getters
for (k, f) in registry.fields {
registry.field_getters.push((k, f))