← 输入框|github.com|刷新
Skip to content

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

Closed

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.

Activity

  1. changed the title [-]Bug: Dict method do not work on a `Const dict`[/-] [+]Bug: Dict methoda do not work on a `Const dict`[/+] on Mar 7, 2024
  2. changed the title [-]Bug: Dict methoda do not work on a `Const dict`[/-] [+]Bug: Dict methods do not work on a `Const dict`[/+] on Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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