Skip to content

Instantly share code, notes, and snippets.

@headius

headius/.diff Secret

Created April 26, 2022 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/0c6d09980c36e3d5845e84adc804d9c4 to your computer and use it in GitHub Desktop.
Save headius/0c6d09980c36e3d5845e84adc804d9c4 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/RubyModule.java b/core/src/main/java/org/jruby/RubyModule.java
index 2f2ade1157..be51afa239 100644
--- a/core/src/main/java/org/jruby/RubyModule.java
+++ b/core/src/main/java/org/jruby/RubyModule.java
@@ -3029,7 +3029,7 @@ public class RubyModule extends RubyObject {
@JRubyMethod(name = "attr_accessor", rest = true, reads = VISIBILITY)
public IRubyObject attr_accessor(ThreadContext context, IRubyObject[] args) {
// Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed
- Visibility visibility = context.getCurrentVisibility();
+ Visibility visibility = getCurrentVisibilityForDefineMethod(context);
IRubyObject[] result = new IRubyObject[2 * args.length];
for (int i = 0; i < args.length; i++) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment