Skip to content

Improve unterminated block exception #4917

@Sporarum

Description

@Sporarum

Currently

raise FunctionDeclarationException(
    f"Missing return statement in function '{self.fn_node.name}'", self.fn_node

does not highlight the position of the missing return

This can be added by refactoring _is_terminated (the function called just before this check) to emit the test instead, and replace it's default return False by a raise which takes the current node a position (as opposed to currently the function node)

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