Repository navigation
Conversation
RbsTranslator mapped singleton(X) to the instance type X, so a parameter declared singleton(Resource) rejected a class argument (received Class<Task>) and accepted an instance instead. Translate it to Class<X>, which Solargraph already resolves to X's class methods.
apiology
added a commit
that referenced
this pull request
Nov 17, 2026
singleton(X) is the class object, but the translator produced an instance of X: passing a subclass where RBS expects singleton(X) was reported as a wrong argument type, and passing an instance was accepted. Carried over from #364. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LTpguHxFEQL9KJ7MGedKby
Owner
Author
|
Claude: Moved into castwide/solargraph#1104, which now translates |
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:
In RBS,
singleton(X)is the type of the class objectXitself (or a subclass), not of its instances.Passing a class to an RBS
singleton(...)parameter is rejected:Any gem RBS declaring
singleton(X)reports correct calls as errors, while an instance passed there goes unflagged; responders' RBS typesActionController::Base.respondersassingleton(ActionController::Responder), which Solargraph reads as aResponderinstance.Solution:
Translate RBS
singleton(X)toClass<X>instead of the instance typeX, so class arguments conform and calls on asingleton(X)result resolve to class methods.