Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@kmr-srbh

Description

@kmr-srbh

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.

Metadata

Metadata

Assignees

No one assigned

    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