Skip to content

Array results should borrow the passed array #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mark-koch opened this issue May 23, 2025 · 0 comments · May be fixed by #1020
Open

Array results should borrow the passed array #981

mark-koch opened this issue May 23, 2025 · 0 comments · May be fixed by #1020
Assignees
Labels
bug Something isn't working

Comments

@mark-koch
Copy link
Collaborator

Currently, programs like

xs = array(1, 2, 3)
result("foo", xs)
result("bar", xs)

create a Hugr where the xs port is used twice. This violates our no-implicit-copy guarantee!

Note: Fixing this requires chaning the array result Hugr op to return back the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants