diff --git a/Compiler/library.py b/Compiler/library.py index 4af9ae1d9..4c9c7fcc7 100644 --- a/Compiler/library.py +++ b/Compiler/library.py @@ -1280,8 +1280,9 @@ def _run_and_link(function, g=None): pre = copy.copy(g) res = function() if g: + from .types import _single for name, var in pre.items(): - if isinstance(var, program.Tape.Register): + if isinstance(var, (program.Tape.Register, _single)): new_var = g[name] if id(new_var) != id(var): new_var.link(var) diff --git a/Compiler/types.py b/Compiler/types.py index c7042542d..ffdfee87c 100644 --- a/Compiler/types.py +++ b/Compiler/types.py @@ -3353,6 +3353,9 @@ def __ne__(self, other): op.__doc__ = __eq__.__doc__ del op + def link(self, other): + self.v.link(other.v) + class _fix(_single): """ Secret fixed point type. """ __slots__ = ['v', 'f', 'k']