File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/main/java/org/truffleruby/language/constants Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,12 @@ protected Object autoloadConstant(
146
146
public static void autoloadConstantStart (RubyContext context , RubyConstant autoloadConstant , Node currentNode ) {
147
147
autoloadConstant .getAutoloadConstant ().startAutoLoad (context , currentNode );
148
148
149
- // We need to notify cached lookup that we are autoloading the constant, as constant
150
- // lookup changes based on whether an autoload constant is loading or not (constant
151
- // lookup ignores being-autoloaded constants).
152
- autoloadConstant .getDeclaringModule ().fields .newConstantVersion (autoloadConstant .getName ());
149
+ if (!autoloadConstant .getAutoloadConstant ().isPublished ()) {
150
+ // We need to notify cached lookup that we are autoloading the constant, as constant
151
+ // lookup changes based on whether an autoload constant is loading or not (constant
152
+ // lookup ignores being-autoloaded constants).
153
+ autoloadConstant .getDeclaringModule ().fields .newConstantVersion (autoloadConstant .getName ());
154
+ }
153
155
}
154
156
155
157
@ TruffleBoundary
You can’t perform that action at this time.
0 commit comments