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.
1 parent 364592d commit 100601eCopy full SHA for 100601e
src/code.jl
@@ -786,7 +786,8 @@ end
786
787
CSEState() = CSEState(Union{Assignment, DestructuredArgs}[], IdDict(), Ref(1))
788
789
-Base.copy(x::CSEState) = CSEState(copy(x.sorted_exprs), copy(x.visited), Ref(x.varid[]))
+# the copy still references the same `varid` Ref to work in nested scopes
790
+Base.copy(x::CSEState) = CSEState(copy(x.sorted_exprs), copy(x.visited), x.varid)
791
792
"""
793
$(TYPEDSIGNATURES)
0 commit comments