Skip to content

Issue with print_list_tuple pass #1862

Closed
@czgdp1807

Description

@czgdp1807

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions