Fix @yieldparam type lost on multi-overload block-form methods - #1290
Fix @yieldparam type lost on multi-overload block-form methods#1290apiology wants to merge 1 commit into
Conversation
…ide#1289) Pin::Method#generate_signature always read @yieldparam/@yieldreturn tags from the method's own docstring, even when building a signature for an @overload tag. Per YARD, @overload docstrings are self-contained, so a block-form overload's @yieldparam was ignored whenever the method had a second, plain overload declared alongside it, and the block-local variable resolved as untyped at the call site. generate_signature now accepts the docstring to read those tags from, and #signatures passes each overload tag's own docstring instead of the method's. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZghMwHqapBNWpbjUQdcFr
9214875 to
0b60c02
Compare
…k-form methods Pin::Method#generate_signature always read @yieldparam/@yieldreturn tags from the method's own docstring, even when it was building the Signature for an @overload tag. Per YARD, @overload docstrings are self-contained, so when a method declared a block-form @overload alongside a second, plain @overload, the block-form overload's @yieldparam was silently dropped - the block-local variable resolved as untyped at the call site. generate_signature now takes the docstring to read those tags from, and #signatures passes each overload tag's own docstring instead of the method's. Fixes castwide#1289 Clean auto-merge, no conflicts. Hit an unrelated environment issue on the first commit attempt: this worktree's PATH has /Users/broz/src/plate-spinner/bin ahead of ~/.rbenv/shims (a known issue from earlier this session), so overcommit's pre-commit hook resolved a bare `bundle` to that other project's toolchain and failed to load the Gemfile. Retried via `direnv exec . env PATH="/Users/broz/.rbenv/shims:$PATH" git commit`, which resolved cleanly. Verified: spec/pin/method_spec.rb, spec/type_checker/levels/strong_spec.rb (145 examples, 0 failures, 5 pending), and a broader safety net - spec/type_checker, spec/pin, spec/yard_map (479 examples, 0 failures, 15 pending).
|
🤖 Filed by Claude, not Vince — acting on his credentials. This fixes require 'net/http'
Net::HTTP.start('example.com', use_ssl: true) do |http|
http.request(Net::HTTP::Get.new('/'))
endDropping |
|
🤖 Filed by Claude, not Vince — acting on his credentials. Root cause isn't RBS-specific. Confirmed this predates and is independent of this PR's Fix and reproduction (matching the case above) are up at #1292. |
Summary
Fixes #1289.
Pin::Method#generate_signaturealways read@yieldparam/@yieldreturntags from the method's own docstring, even when it was building theSignaturefor an@overloadtag. Per YARD,@overloaddocstrings are self-contained, so when a method declared a block-form@overloadalongside a second, plain@overload, the block-form overload's@yieldparamwas silently dropped — the block-local variable resolved as untyped at the call site.generate_signaturenow takes the docstring to read those tags from, and#signaturespasses each overload tag's own docstring instead of the method's.Test plan
bundle exec rspec(1443 examples, 0 failures)bundle exec rubocopon changed files (clean)solargraph typecheck --level strongon the issue's repro now reports 0 problems