We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
HashConsingWrapper
WeakKeyDict
1 parent fcd6b52 commit 8bb339eCopy full SHA for 8bb339e
src/types.jl
@@ -86,7 +86,15 @@ function exprtype(x::BasicSymbolic)
86
end
87
88
89
-const wvd = TaskLocalValue{WeakValueDict{UInt, BasicSymbolic}}(WeakValueDict{UInt, BasicSymbolic})
+mutable struct HashConsingWrapper
90
+ bs::BasicSymbolic
91
+end
92
+
93
+Base.hash(x::HashConsingWrapper, h::UInt) = hash2(x.bs, h)
94
95
+Base.isequal(x::HashConsingWrapper, y::HashConsingWrapper) = isequal_with_metadata(x.bs, y.bs)
96
97
+const wkd = TaskLocalValue{WeakKeyDict{HashConsingWrapper, Nothing}}(WeakKeyDict{HashConsingWrapper, Nothing})
98
99
# Same but different error messages
100
@noinline error_on_type() = error("Internal error: unreachable reached!")
0 commit comments