You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a variable is overwritten from a block scope, steep ignores the overwrite. Example:
value = nil
loop do
value = 1
break
end
value + 2
puts value
Result:
% be steep check
# Type checking files:
...................................................................................F
test.rb:8:6: [error] Type `nil` does not have method `+`
│ Diagnostic ID: Ruby::NoMethod
│
└ value + 2
~
Detected 1 problem from 1 file
The above example is valid Ruby code. Is there a way to not have steep generate an error on it?
A more real-world usage example of the same pattern is Benchmark.realtime:
value = nil
time = Benchmark.realtime do
value = ...
end
The text was updated successfully, but these errors were encountered:
When a variable is overwritten from a block scope, steep ignores the overwrite. Example:
Result:
The above example is valid Ruby code. Is there a way to not have steep generate an error on it?
A more real-world usage example of the same pattern is Benchmark.realtime:
The text was updated successfully, but these errors were encountered: