FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bug: "x : i32 = test()" fails at top level · Issue #1667 · lcompilers/lpython · GitHub

Bug: "x : i32 = test()" fails at top level #1667

Description

Running

def test() -> i32:
    temp: i32 = 0
    return temp

x : i32 = test()
# print(x)  Will give segmentation fault

gives code generation error: Function code not generated for 'test' .

But declaring and assigning in different line

x : i32
x = test()
print(x)

compiles successfully.
Not sure if this is intentional. This type of code runs fine in CPython.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL