Skip to content

Commit

Permalink
Module#kind_of? and #<= should look for origin.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Feb 22, 2019
1 parent 081230d commit 2bf2413
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/IncludedModule.java
Expand Up @@ -63,6 +63,11 @@ protected Map<String, IRubyObject> getClassVariablesForRead() {
return origin.getClassVariablesForRead();
}

@Override
protected boolean isSame(RubyModule module) {
return origin.isSame(module.getDelegate());
}

/** The module to which this include origins. */
protected final RubyModule origin;
}
5 changes: 0 additions & 5 deletions core/src/main/java/org/jruby/IncludedModuleWrapper.java
Expand Up @@ -100,11 +100,6 @@ public boolean isPrepended() {
return origin.hasPrepends();
}

@Override
protected boolean isSame(RubyModule module) {
return origin.isSame(module.getDelegate());
}

@Override
public Map<String, DynamicMethod> getMethods() {
return origin.getMethods();
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyModule.java
Expand Up @@ -264,7 +264,7 @@ public boolean isSingleton() {
public static class KindOf {
public static final KindOf DEFAULT_KIND_OF = new KindOf();
public boolean isKindOf(IRubyObject obj, RubyModule type) {
return obj.getMetaClass().hasModuleInHierarchy(type);
return obj.getMetaClass().hasModuleInHierarchy(type.getMethodLocation());
}
}

Expand Down

0 comments on commit 2bf2413

Please sign in to comment.