Remove duplicate dead methods in RbsMap::Conversions - #41
Closed
apiology wants to merge 1 commit into
Closed
Conversation
Two pairs of duplicate method definitions (parts_of_function, build_type) exist in this file, where an old implementation was left in place, shadowed and made unreachable by a newer one added elsewhere in the file - Ruby silently uses the later definition, so the earlier one is dead code. The dead build_type/parts_of_function reference two helper methods (other_type_to_type, method_type_to_type) that don't exist anywhere in lib/, so either would raise NoMethodError if ever reached. Also fixes a merge artifact: a `# rubocop:enable` comment had gotten concatenated onto the same line as the next method's docstring comment, which both broke the rubocop directive and orphaned the docstring. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Aug 2, 2026
Owner
Author
|
Resubmitting this against castwide/solargraph upstream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
RbsMap::Conversions#build_typeand#parts_of_functionare each defined twice in this file. Ruby silently uses the later definition, so the earlier one is dead code — but it's live-looking dead code: it references two helper methods (other_type_to_type,method_type_to_type) that don't exist anywhere inlib/, so if anything ever called the shadowed version, it would raiseNoMethodError. Nothing currently reaches it, but it's a landmine for the next refactor that touches this file and doesn't know to check which definition actually runs.How
Delete the earlier (shadowed) definitions of both methods. Also fixes a merge artifact nearby: a
# rubocop:enablecomment had gotten concatenated onto the same line as the next method's docstring, breaking both the rubocop directive and the docstring.What's in it
lib/solargraph/rbs_map/conversions.rb: -100/+2 lines, no behavior change (dead code removed).Testing:
bundle exec rspec spec/rbs_map/— 30 examples, 0 failures, 4 pending.