Skip to content
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

Fix symbolic pass for handling IntrinsicElementalFunction in print() #2665

Conversation

kmr-srbh
Copy link
Contributor

@kmr-srbh kmr-srbh commented Apr 25, 2024

fixes #2457

from lpython import i32

def f():
    a :list[i32]= [1, 2, 3, 4,]
    print(a.pop(),a)
    
f()
(lp) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
4 [1, 2, 3]

@kmr-srbh
Copy link
Contributor Author

@Shaikh-Ubaid could you please suggest some more testcases?

@Shaikh-Ubaid
Copy link
Collaborator

from lpython import i32

def f():
    a :list[i32]= [1, 2, 3, 4,]
    print(a.pop(),a)
    
f()

Can you add this exact test case?

@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as draft April 25, 2024 20:05
@Shaikh-Ubaid
Copy link
Collaborator

Please mark as "Ready for review" when ready.

@kmr-srbh kmr-srbh marked this pull request as ready for review April 26, 2024 14:01
@kmr-srbh
Copy link
Contributor Author

@Shaikh-Ubaid could you please look into the reason for the failing checks? They seem unrelated to the PR.

@kmr-srbh kmr-srbh force-pushed the fix-symblic-pass-for-printing-intrinsic-elemental-function branch from 658e561 to e38ee36 Compare April 27, 2024 05:07
@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as draft April 27, 2024 07:01
@kmr-srbh kmr-srbh marked this pull request as ready for review April 27, 2024 08:30
Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks. It looks great!

@Shaikh-Ubaid Shaikh-Ubaid force-pushed the fix-symblic-pass-for-printing-intrinsic-elemental-function branch from d322154 to 1e15742 Compare April 27, 2024 09:00
@Shaikh-Ubaid Shaikh-Ubaid enabled auto-merge (squash) April 27, 2024 09:00
@Shaikh-Ubaid Shaikh-Ubaid merged commit 206035e into lcompilers:main Apr 27, 2024
14 checks passed
assem2002 pushed a commit to assem2002/lpython that referenced this pull request Apr 28, 2024
…()` (lcompilers#2665)

* Fix symbolic pass for handling `IntrinsicElementalFunction` in `print()`

* Tests: Add tests and  update references

* Fix mistakenly commented out lines

* Tests: Add testcase and update references

* Tests: Update references

* Style changes

* Remove C backend

* Tests: Add asserts and update test reference
assem2002 pushed a commit to assem2002/lpython that referenced this pull request Apr 28, 2024
…()` (lcompilers#2665)

* Fix symbolic pass for handling `IntrinsicElementalFunction` in `print()`

* Tests: Add tests and  update references

* Fix mistakenly commented out lines

* Tests: Add testcase and update references

* Tests: Update references

* Style changes

* Remove C backend

* Tests: Add asserts and update test reference
@kmr-srbh kmr-srbh deleted the fix-symblic-pass-for-printing-intrinsic-elemental-function branch May 2, 2024 13:59
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 this pull request may close these issues.

print() messes up with integer returned by list.pop()
2 participants