lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.37k stars 156 forks source link

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

Closed kmr-srbh closed 2 months ago

kmr-srbh commented 2 months ago

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 commented 2 months ago

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

Shaikh-Ubaid commented 2 months ago
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 commented 2 months ago

Please mark as "Ready for review" when ready.

kmr-srbh commented 2 months ago

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