Fix bug in alias mappings (#1252)

This commit is contained in:
gvolfing
2023-10-23 13:07:46 +02:00
committed by GitHub
parent 7f7f3adfcb
commit aec4c3dd2b
2 changed files with 6 additions and 5 deletions

View File

@@ -1331,15 +1331,17 @@ std::optional<std::pair<ModulePtr, const T *>> MakePairIfPropFound(const ModuleR
if (!result) {
return std::nullopt;
}
auto [module_name, prop_name] = *result;
auto [module_name, module_prop_name] = *result;
auto module = module_registry.GetModuleNamed(module_name);
auto prop_name = std::string(module_prop_name);
if (!module) {
// Check for possible callable aliases.
const auto maybe_valid_alias = gCallableAliasMapper.FindAlias(std::string(fully_qualified_name));
if (maybe_valid_alias) {
result = FindModuleNameAndProp(module_registry, *maybe_valid_alias, memory);
auto [module_name, prop_name] = *result;
auto [module_name, module_prop_name] = *result;
module = module_registry.GetModuleNamed(module_name);
prop_name = std::string(module_prop_name);
if (!module) {
return std::nullopt;
}