Skip to content

BuildError: Cannot lower Raise node (repeat of #211) #659

@jon-wurtz

Description

@jon-wurtz

Sometimes you want to write a kernel but have part of it be a To Do and not yet implemented, or have an out of bound error, etc.

@kernel
def test():
    raise NotImplementedError("To Do")

@kernel
def if_else(x: int):
    if x == 0:
        ...# Do one thing
    elif x == 1:
        ...# Do another thing
    else:
        raise ValueError("Invalid input")

However, we do not allow lowering of Raise in kirin; the code here will raise an error similar to BuildError: Cannot lower Raise node: <ast.Raise object at 0x11a181f90>. Repeating #211.

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: featureCategory: new feature or feature request.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions