Skip to content

Function definitions don't recognize that if all conditionals have a return, it will always return #19

@alinalihassan

Description

@alinalihassan

Function definitions don't recognize that if all conditionals have a return, it will always return. Instead they complain that there's no return in the main block of the function. Take this example:

def test(x: int) -> int
    if x > 5
        return 5
    else
        return 7

Currently Lesma can't compile that. We might be able to get away by just modifying the code generator, not including any analysis steps of sorts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LLVM-specificIssues that are related to LLVM or the Code Generation stepbugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions