Use normal call type error for missing dynamic string to_s#9230
Merged
headius merged 2 commits intojruby:masterfrom Feb 11, 2026
Merged
Use normal call type error for missing dynamic string to_s#9230headius merged 2 commits intojruby:masterfrom
headius merged 2 commits intojruby:masterfrom
Conversation
When calling to_s for a dynamic string, it should dispatch without regards to visibility (like functional or variable call type) but produce a NoMethodError when missing (like normal call type). This hack allows specifying a different "effective call type" to be used for site setup when using SelfInvokeSite to skip visibility checks. The original logic used CallType to indicate both the structure of arguments passed in from the invokedynamic call site and to indicate whether to perform visibility checks. This does not fully disentangle the logic from this dual-meaning but it is sufficient to fix the related issue. Fixes jruby#9222
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.
This fixes #9222 by providing a way to specify the call type to use when choosing a
method_missingerror type. In this case,to_scalled by dynamic string building should behavior like a functional call (not check visibility, no caller passed in) but raise missing method errors like a normal call.This is a bit hacky, due to the original logic assuming the sole provided call type would indicate both the structure of the call site and the visibility-checking behavior. I split that definition here but it is not clean and should be improved as part of the general refactoring of invokedynamic site binding. See #9229.