lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 158 forks source link

Bug: List methods do not work on a `Const list` #2584

Closed kmr-srbh closed 6 months ago

kmr-srbh commented 7 months ago

Trying to use list methods on Const list result in a semantic error.

insert()

l: Const[list[i32]] = [1, 2, 3, 4, 5]
print(l.insert(0, 12))
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
semantic error: Type name is not implemented yet.
 --> ./examples/example.py:8:7
  |
8 | print(l.insert(0, 12))
  |       ^^^^^^^^^^^^^^^ 

Note: Please report unclear or confusing messages as bugs at
https://github.com/lcompilers/lpython/issues.

clear()

l: Const[list[i32]] = [1, 2, 3, 4, 5]
print(l.clear())
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
semantic error: Type name is not implemented yet.
 --> ./examples/example.py:8:7
  |
8 | print(l.clear())
  |       ^^^^^^^^^ 

Note: Please report unclear or confusing messages as bugs at
https://github.com/lcompilers/lpython/issues.

The error is the same for other available methods.