We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
steep check
next x
Hey!
Here is an example:
# @type method foo: () -> String def foo # @type block: String "bar".then do |str| next str.reverse if str == "bar" str end end
Gives me:
$ steep check a.rb:5:4: UnexpectedJumpValue (next str.reverse)
When annotating a block outside of a method, it works:
# @type block: String "bar".then do |str| next str.reverse if str == "bar" str end
$ steep check # all goood
Debug output:
[Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] def [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] block [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [synthesize:(4:3)] str [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] Factory#interface: ::String, private=false, self_type=::String [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(4:18)] procarg0 [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] begin [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] if [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] send [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] [synthesize:(5:25)] lvar [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] Factory#interface: ::String, private=false, self_type=::String [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] [(untyped) -> bool] [synthesize:(5:32)] str [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] [(untyped) -> bool] check_relation: self:::Object |- ::String <: untyped [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] [(untyped) -> bool] [::String <: untyped] result=Steep::Subtyping::Result::Success [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] next [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:10)] send [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:10)] [synthesize:(5:10)] lvar [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:10)] Factory#interface: ::String, private=false, self_type=::String [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [synthesize:(5:5)] [synthesize:(7:5)] lvar [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] check_relation: self:::Object |- ::String <: X(1) [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [::String <: X(1)] result=Steep::Subtyping::Result::Success [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [[X] () { (::String) -> X } -> X] [::String <: ⟙] result=Steep::Subtyping::Result::Success [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(4:18)] procarg0 [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] begin [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] if [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] send [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] [synthesize:(5:25)] lvar [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:25)] [synthesize:(5:32)] str [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] next [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:10)] send [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:5)] [synthesize:(5:10)] [synthesize:(5:10)] lvar [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [synthesize:(4:3)] [() -> ::Enumerator[::String, untyped]] [synthesize:(5:5)] [synthesize:(7:5)] lvar [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] check_relation: self:::Object |- ::String <: ::String [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] [path=a.rb] [synthesize:(2:1)] [::String <: ::String] result=Steep::Subtyping::Result::Success [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] type checking 1 files took 0.019494 seconds [Steep 0.36.0] [target=lib] [target#type_check(target_sources: [a.rb], validate_signatures: true)] load signature and type check took 1.813167 seconds a.rb:5:4: UnexpectedJumpValue (next str.reverse)
The text was updated successfully, but these errors were encountered:
Good find... Thanks!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hey!
Here is an example:
Gives me:
When annotating a block outside of a method, it works:
$ steep check # all goood
Debug output:
The text was updated successfully, but these errors were encountered: