diff --git a/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java b/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java index 4a23dfa8c4f..3f71c9ac912 100644 --- a/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java +++ b/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java @@ -197,7 +197,7 @@ private static InterpreterContext prepareIC(ThreadContext context, DynamicScope IREvalScript script = new IREvalScript(runtime.getIRManager(), containingIRScope, file, lineNumber, staticScope, evalType); // enable refinements if incoming scope already has an overlay active - if (staticScope.getOverlayModuleForRead() != null) { + if (staticScope.getOverlayModuleForRead() != null || staticScope.getIRScope().maybeUsingRefinements()) { script.setIsMaybeUsingRefinements(); }