Skip to content

Commit cdb63b0

Browse files
committed
refactor: fix type instability within get_constants
1 parent 8fd110b commit cdb63b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NodeUtils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ given the output of this function.
7777
Also return metadata that can will be used in the `set_constants!` function.
7878
"""
7979
function get_constants(tree::AbstractExpressionNode{T}) where {T}
80-
refs = filter_map(is_node_constant, node -> Ref(node), tree, Ref{typeof(tree)})
80+
refs = filter_map(
81+
is_node_constant, node -> Ref(node), tree, Base.RefValue{typeof(tree)}
82+
)
8183
return map(ref -> ref[].val::T, refs), refs
8284
# NOTE: Do not remove this `::T` as it is required for inference on empty collections
8385
end

0 commit comments

Comments
 (0)