Skip to content

Commit 4abedab

Browse files
CalMacCQacl-cqc
authored andcommitted
fix: set hugr field of PassResult correctly (#2715)
1 parent 5dccdae commit 4abedab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hugr-py/src/hugr/passes/_composable_pass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def run(self, hugr: Hugr, *, inplace: bool = True) -> PassResult:
3232
3333
See :func:`implement_pass_run` for a helper function to implement this method.
3434
"""
35+
...
3536

3637
@property
3738
def name(self) -> PassName:
@@ -69,10 +70,10 @@ def implement_pass_run(
6970
return inplace_call(hugr)
7071
elif copy_call is not None:
7172
pass_result = copy_call(hugr)
72-
pass_result.hugr = hugr
7373
if pass_result.modified:
7474
hugr._overwrite_hugr(pass_result.hugr)
7575
pass_result.inplace = True
76+
pass_result.hugr = hugr
7677
return pass_result
7778
elif not inplace:
7879
if copy_call is not None:

0 commit comments

Comments
 (0)