From 0f0b703b9381740e12baf2118b239332014ef92d Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Mon, 25 Aug 2025 14:49:43 +0200 Subject: [PATCH] `_register_kinds!`: improve type stability when creating `Vector` Make the temporary `existing_kinds::Vector` infer concretely. NB: a more thorough solution might do away with the construction of `existing_kinds` altogether, however this seems like an OK quick fix. (cherry picked from commit 27741256a1488c5016a3255afa76af56548cbe5d) --- src/kinds.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kinds.jl b/src/kinds.jl index c7d27e35..a392d660 100644 --- a/src/kinds.jl +++ b/src/kinds.jl @@ -88,7 +88,7 @@ function _register_kinds!(kind_modules, int_to_kindstr, kind_str_to_int, mod, mo # Ok: known kind module, but not loaded until now kind_modules[module_id] = mod elseif m == mod - existing_kinds = [(i = get(kind_str_to_int, n, nothing); + existing_kinds = Union{Nothing, Kind}[(i = get(kind_str_to_int, n, nothing); isnothing(i) ? nothing : Kind(i)) for n in names] if any(isnothing, existing_kinds) || !issorted(existing_kinds) ||