Repository navigation
Conversation
Core RBS declares Array#compact and Enumerable#compact as () -> ::Array[Elem] and Hash#compact as () -> ::Hash[K, V], so the result keeps nil from its receiver and every element call reports "Unresolved call to upcase on String, NilClass". There is no block or method type variable for generic binding to use, and RBS cannot write Elem minus nil. Drop nil and NilClass from the element types (Hash: value types) of those three resolved pins in Chain::Call#inferred_pins. compact!, compact methods on other classes and all-nil element types are left unchanged. Removes the now-unneeded ignore marker in Pin::Search#do_query.
Replace the hard-coded Array#compact, Enumerable#compact and
Hash#compact paths in Chain::Call with %a{solargraph:removes-nil}.
Conversions records the annotation (on the method, or on every
overload) as Pin::Method#removes_nil?, so a user's own RBS methods can
use it too.
rbs/annotations reopens the core classes with 'def compact: ...'.
RbsMap::Core loads it with the fills, keeps its pins out of the core
pins, and copies their annotations onto the core methods, which keep
their core signatures.
rbs/annotations holds every annotation file RbsMap::Core reads; one file per annotation keeps them apart as more are added.
apiology
added a commit
that referenced
this pull request
Oct 25, 2026
Solargraph-read annotation fills share one directory: move the %a{pure}
markers to rbs/annotations/pure.rbs and load the whole directory in the
fills loader, splitting its pins out by filename and copying their
annotations onto core methods. #348 loads the same
directory the same way, so the two merge into one loader instead of a
second EnvironmentLoader, whose core_root marker goes with it.
Owner
Author
|
Claude: Opened upstream as castwide#1458. |
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.
Claude: This PR was written by Claude Code on behalf of @apiology.
Problem:
Calling
compactdoesn't remove nil from element types:Every element call after
compactreports a false possible nil.Solution:
Drop nil from the element types of resolved
Array#compact,Enumerable#compactandHash#compact(values only) pins, because their RBS signatures (() -> ::Array[Elem]) have no block or method type variable for generic binding to narrow, so #202 leaves this unchanged.Not covered:
compact!(stillArray<String, NilClass>, nil), andx = x.compactreassignments, which keep the pre-compacttype through a separate defect.Markers cleared: 1