Skip to content
New issue

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: &nil is treated as block #268

Closed
palkan opened this issue Dec 7, 2020 · 0 comments · Fixed by #356
Closed

steep check: &nil is treated as block #268

palkan opened this issue Dec 7, 2020 · 0 comments · Fixed by #356
Assignees
Labels

Comments

@palkan
Copy link
Sponsor

palkan commented Dec 7, 2020

Example:

# a.rb
class A
  def foo(val)
    val
  end
end

class B < A
  def foo(val, &block)
    block.call super(val, &nil)
  end
end

# a.rbs
class A
  def foo: (String) -> String
end

class B < A
  def foo: (String) { (String) -> String} -> String
end

Running Steep check:

$ steep check

a.rb:9:15: UnexpectedBlockGiven: method_type=(::String) -> ::String (super(val, &nil))

Removing &nil works with steep check but breaks when using rbs/test/setup (with UnexpectedBlockError: unexpected block is given for ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants