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

Skip to content

Bug: Global declaration of set fails #2604

Closed
@kmr-srbh

Description

@kmr-srbh

Declaring a set in the global scope fails. This however is not the case with a local scope like a function.

s: set[str] = {"a", "b", "c", "a"}
s.add("d")
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
code generation error: Variable type not supported 6
 --> ./examples/example.py:1:1
  |
1 | s: set[str] = {"a", "b", "c", "a"}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 


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

As it turns out, the error message is not clear too.

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