lazy_object: update block parameter to fix Ruby warning by p-linnane · Pull Request #21271 · Homebrew/brew

Conversation

@p-linnane

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

Followup to #21263.

Fixes /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.6.12815/lib/types/private/methods/call_validation.rb:282: warning: the block passed to 'LazyObject#__getobj__' defined at /opt/homebrew/Library/Homebrew/lazy_object.rb:17 may be ignored

Signed-off-by: Patrick Linnane <patrick@linnane.io>

Copilot AI review requested due to automatic review settings

December 17, 2025 18:12

Bo98

Bo98 approved these changes Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Ruby warning from Sorbet runtime about a potentially ignored block parameter in the LazyObject#__getobj__ method. The warning was introduced after PR #21263.

Key Changes:

  • Updated the method signature to explicitly accept a block parameter &_blk
  • Added Sorbet type signature for the block parameter using params(_blk: T.untyped)
  • The block is intentionally unused, as indicated by the underscore prefix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

3 participants

@p-linnane @Bo98