Skip to content

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

Closed
@gptsarthak

Description

@gptsarthak

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