Skip to content

Commit 2774125

Browse files
committed
_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.
1 parent 1320b6e commit 2774125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/julia/kinds.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function _register_kinds!(kind_modules, int_to_kindstr, kind_str_to_int, mod, mo
8888
# Ok: known kind module, but not loaded until now
8989
kind_modules[module_id] = mod
9090
elseif m == mod
91-
existing_kinds = [(i = get(kind_str_to_int, n, nothing);
91+
existing_kinds = Union{Nothing, Kind}[(i = get(kind_str_to_int, n, nothing);
9292
isnothing(i) ? nothing : Kind(i)) for n in names]
9393
if any(isnothing, existing_kinds) ||
9494
!issorted(existing_kinds) ||

0 commit comments

Comments
 (0)