Closed wilsonsilva closed 6 months ago
Thank you for reporting the problem. Confirmed. @wilsonsilva
The problem is caused because method call purity of pubkey()
is omitted during type checking the ||
clause.
Released 1.7.0.dev.3
with the fix for this problem.
Worked like a charm. Thank you!
Problem
Steep ignores 3
nil
checks on the same expression.Offending code:
RBS:
Expected behaviour
No errors should be reported by Steep. The method
valid_sig?
requires non-nullable arguments. And the methodverify_signature
ensures that the argumentsid
,pubkey
andsig
are not null before calling the methodvalid_sig?
.Actual behaviour
The following error is reported by Steep:
But only when the 3 nil checks on the same expression. Fewer nil checks do not trigger the error.
Workaround
Use 2 or fewer nil checks on the same expression.
Steps to reproduce
git clone git@github.com:wilsonsilva/steep-nil-argument-type-mismatch-bug.git
bundle install
bundle exec steep check
Environment
3.3.0
1.6.0
3.4.4
macOS Sonoma 14.4 (23E214)
A tiny sample project to reproduce the problem https://github.com/wilsonsilva/steep-nil-argument-type-mismatch-bug