Skip to content

Issue with print_list_tuple pass #1862

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

Closed
czgdp1807 opened this issue May 27, 2023 · 0 comments · Fixed by #1868
Closed

Issue with print_list_tuple pass #1862

czgdp1807 opened this issue May 27, 2023 · 0 comments · Fixed by #1868
Assignees

Comments

@czgdp1807
Copy link
Collaborator

czgdp1807 commented May 27, 2023

The problem is with print_list_tuple ASR pass. It transforms print(l.pop()) into print(l.pop()[0], l.pop()[1]) which calls l.pop twice leading to the error because in second call to l.pop() the list is empty. The correct transformation would be t = l.pop(); print(t).

Originally posted by @czgdp1807 in #1845 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants