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
ActionView::Helpers::RenderingHelper#render
When calling the #render method from a helper in a Rails app, for example:
#render
module ApplicationHelper def render_partial(name, options) render(partial: name, **options) end end
the current type definitions throw an error when validating in Steep due to an incorrect signature: rbs:
module ApplicationHelper : ActionView::Helpers def render_partial: (String name, Hash[Symbol, untyped] options) -> String end
steep output:
[error] The method cannot be called without a block │ Diagnostic ID: Ruby::RequiredBlockMissing │ └ render( ~~~~~~
This specific one comes from ActionView::Helpers::RenderingHelper#render, which is defined on https://github.com/ruby/gem_rbs_collection/blob/main/gems/actionview/6.0/actionview-generated.rbs#L6603
def render: (?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] locals) { () -> untyped } -> untyped
The patch to fix it is to make the block optional, ie ?{ () -> untyped }
?{ () -> untyped }
I'm happy to make a PR to address, but not sure if you would prefer to update the generated files or the patch.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When calling the
#render
method from a helper in a Rails app, for example:the current type definitions throw an error when validating in Steep due to an incorrect signature:
rbs:
steep output:
[error] The method cannot be called without a block │ Diagnostic ID: Ruby::RequiredBlockMissing │ └ render( ~~~~~~
This specific one comes from
ActionView::Helpers::RenderingHelper#render
, which is defined on https://github.com/ruby/gem_rbs_collection/blob/main/gems/actionview/6.0/actionview-generated.rbs#L6603The patch to fix it is to make the block optional, ie
?{ () -> untyped }
I'm happy to make a PR to address, but not sure if you would prefer to update the generated files or the patch.
The text was updated successfully, but these errors were encountered: