Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Bug: Dict methods do not work on a Const dict #2585

@kmr-srbh

Description

@kmr-srbh

Trying to use dict methods on Const dict result in a Internal Compiler Error.

get()

d: Const[dict[str, i32]] = {"a": 1, "b": 2, "c": 3}
print(d.get("a"))
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
.
.
.
AssertFailed: is_a<T>(*f)

keys()

d: Const[dict[str, i32]] = {"a": 1, "b": 2, "c": 3}
print(d.keys())
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
.
.
.
AssertFailed: is_a<T>(*f)

The error is the same for other available methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions