You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make use of the new functionality in Julia 1.8 introduced here: JuliaLang/julia#43305
Should hopefully be able to annotate both members of Node, since the structure itself is only mutable to allow finalizers to run.
Two things to consider:
How to do this in a way that doesn't break compatibility with Julia 1.6?
If both fields are marked as const, will this break finalizers for the object?
We should test that the fields actually cannot be mutated.
Note that a `Node` is only declared mutable so that we can attach finalizers to
instances. This is required for the [`WeakIdentityMap`](@ref) to work.
Nodes should NEVER actually be mutated!
Due to subgraph elimination, nodes that are equivalent should always be identical objects.
We therefore leave `hash` & `==` defined in terms of the `objectid`.
"""
mutable struct Node{T}
parents::NTuple{N,Node}where {N}
op::NodeOp{T}
end
1 — if no neater solution is available, should just be able to do a switch based on the VERSION >= v"1.8", so as to switch between two different struct definitions.
2 — the tests should catch this if it breaks.
The text was updated successfully, but these errors were encountered:
Make use of the new functionality in Julia 1.8 introduced here: JuliaLang/julia#43305
Should hopefully be able to annotate both members of
Node
, since the structure itself is only mutable to allow finalizers to run.Two things to consider:
const
, will this break finalizers for the object?TimeDag.jl/src/core.jl
Lines 14 to 25 in 2216089
1 — if no neater solution is available, should just be able to do a switch based on the
VERSION >= v"1.8"
, so as to switch between two different struct definitions.2 — the tests should catch this if it breaks.
The text was updated successfully, but these errors were encountered: