steep
steep copied to clipboard
`FallbackAny` with local variable in ensure block
This code is valid Ruby:
class LocalVarInEnsure
def test(check)
a = 10
return a if check
0
ensure
puts a
end
end
But running latest steep with configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) or FallbackAny set to :error will result in this:
lib/playground/local_var_in_ensure.rb:8:9: [warning] Cannot detect the type of the expression
│ Diagnostic ID: Ruby::FallbackAny
│
└ puts a
~
It looks similar to https://github.com/soutaro/steep/issues/919