diff --git a/src/kinds.jl b/src/kinds.jl index c7d27e35..b6f0723a 100644 --- a/src/kinds.jl +++ b/src/kinds.jl @@ -102,6 +102,12 @@ function _register_kinds!(kind_modules, int_to_kindstr, kind_str_to_int, mod, mo error("Kind module ID $module_id already claimed by module $m") end end + _register_kinds_names!(int_to_kindstr, kind_str_to_int, module_id, names) +end + +# This function is separated from `_register_kinds!` to prevent sharing of the variable `i` +# here and in the closure in `_register_kinds!`, which causes boxing and bad inference. +function _register_kinds_names!(int_to_kindstr, kind_str_to_int, module_id, names) # Process names to conflate category BEGIN/END markers with the first/last # in the category. i = 0