Skip to content

Commit

Permalink
Include wrappers and meta classes should use super's class index.
Browse files Browse the repository at this point in the history
Fixes #4340.
  • Loading branch information
headius committed Nov 29, 2016
1 parent e56920c commit 2661806
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/IncludedModule.java
Expand Up @@ -9,6 +9,9 @@ public IncludedModule(Ruby runtime, RubyClass superClass, RubyModule origin) {
super(runtime, superClass, false);
this.origin = origin;
this.metaClass = origin.metaClass;
if (superClass != null) {
setClassIndex(superClass.getClassIndex()); // use same ClassIndex as metaclass, since we're technically still of that type
}
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/MetaClass.java
Expand Up @@ -38,7 +38,7 @@ public final class MetaClass extends RubyClass {
public MetaClass(Ruby runtime, RubyClass superClass, IRubyObject attached) {
super(runtime, superClass, false);
this.attached = attached;
setClassIndex(superClass.classIndex); // use same ClassIndex as metaclass, since we're technically still of that type
setClassIndex(superClass.getClassIndex()); // use same ClassIndex as metaclass, since we're technically still of that type
}

@Override
Expand Down

0 comments on commit 2661806

Please sign in to comment.