Skip to content

Commit f29b80b

Browse files
committed
Don't directly hash a Julia function
1 parent 0c48498 commit f29b80b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/types.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ function Base.hash(t::Term, salt::UInt)
335335
!iszero(salt) && return hash(hash(t, zero(UInt)), salt)
336336
h = t.hash[]
337337
!iszero(h) && return h
338-
h′ = hashvec(arguments(t), hash(operation(t), salt))
338+
op = operation(t)
339+
oph = op isa Function ? nameof(op) : op
340+
h′ = hashvec(arguments(t), hash(oph, salt))
339341
t.hash[] = h′
340342
return h′
341343
end

0 commit comments

Comments
 (0)