diff --git a/sol/simple_usertype_metatable.hpp b/sol/simple_usertype_metatable.hpp index 71ca36b1..4f94b36a 100644 --- a/sol/simple_usertype_metatable.hpp +++ b/sol/simple_usertype_metatable.hpp @@ -415,14 +415,14 @@ namespace sol { auto& properties = umx.properties; auto sic = hasindex ? &usertype_detail::simple_index_call : &usertype_detail::simple_index_call; auto snic = hasnewindex ? &usertype_detail::simple_new_index_call : &usertype_detail::simple_new_index_call; - auto register_kvp = [&](std::size_t i, stack_reference& t, const std::string& first, object& second) { + auto register_kvp = [&](std::size_t meta_index, stack_reference& t, const std::string& first, object& second) { meta_function mf = meta_function::construct; - for (std::size_t i = 1; i < properties.size(); ++i) { - mf = static_cast(i); + for (std::size_t j = 1; j < properties.size(); ++j) { + mf = static_cast(j); const std::string& mfname = to_string(mf); if (mfname != first) continue; - properties[i] = true; + properties[j] = true; switch (mf) { case meta_function::index: umx.indexfunc = second; @@ -435,7 +435,7 @@ namespace sol { } break; } - switch (i) { + switch (meta_index) { case 0: if (mf == meta_function::garbage_collect) { return;