Skip to content

noreturn branch tag #2086

@kddnewton

Description

@kddnewton

Hello! I am hoping for a noreturn branch flag feature that will indicate to steep that if a branch is taken, control flow does not return to the caller. For example:

# @rbs noreturn
def raise_error(node)
  # ...
end

def compile(node)
  case node
  when Foo
    compile_foo(node)
  when Bar
    compile_bar(node)
  else
    raise_error(node)
  end
end

Currently this will union the types of compile_foo, compile_bar, and raise_error. I am hoping to have it ignore the return type of raise_error instead. (Note I do see that some methods use a return type of bot for this purpose, but I figured I'd check since noreturn is in other systems.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions