Skip to content

private_constant should just update existing autoload#8995

Merged
headius merged 1 commit intojruby:masterfrom
headius:private_constant_autoload
Sep 5, 2025
Merged

private_constant should just update existing autoload#8995
headius merged 1 commit intojruby:masterfrom
headius:private_constant_autoload

Conversation

@headius
Copy link
Member

@headius headius commented Sep 5, 2025

The logic here was proceeding to set the existing autoload to UNDEF, which then triggered it to be removed as a failed autoload. This left us with a constant table containing a private entry of UNDEF but no autoload in the table to load for it.

The modified logic checks if the incoming value was also UNDEF, indicating that the value was a previously-unloaded or in-progress autoload, and leaves the autoload table alone while just updating the constant table with the new visibility.

Fixes #8923

The logic here was proceeding to set the existing autoload to
UNDEF, which then triggered it to be removed as a failed autoload.
This left us with a constant table containing a private entry of
UNDEF but no autoload in the table to load for it.

The modified logic checks if the incoming value was also UNDEF,
indicating that the value was a previously-unloaded or in-progress
autoload, and leaves the autoload table alone while just updating
the constant table with the new visibility.

Fixes jruby#8923
@headius headius added this to the JRuby 10.0.3.0 milestone Sep 5, 2025
@headius headius merged commit c7151b7 into jruby:master Sep 5, 2025
75 checks passed
@headius headius deleted the private_constant_autoload branch September 5, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NameError for autoloaded constant with private_constant

1 participant