Skip to content

steep check displays UnexpectedJump for retry syntax with correct usage #293

@pocke

Description

@pocke

steep check displays UnexpectedJump for retry syntax even if the retry is used with correct usage.
For example:

# test.rb

begin
rescue
  retry
end
# Steepfile
target :lib do
  check 'test.rb'
end
$ steep --version
0.39.0
$ steep check
test.rb:5:2: UnexpectedJump (retry)

The retry is correct because retry is allowed only in a rescue clause.
So I expect no error but steep check reports an error.

Because it requires break_context for retry, but rescue clauses doesn't have break_context.

unless break_context
typing.add_error Errors::UnexpectedJump.new(node: node)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions