Skip to content

Commit

Permalink
revert previous fix for detecting alias-ed method's defined class
Browse files Browse the repository at this point in the history
has introduced a regression, thus instead tagging #inspect back
```
     [exec] UnboundMethod#owner returns the new owner for aliased methods on singleton classes FAILED
     [exec] Expected #<Class:UnboundMethodSpecs::Parent>
     [exec] to equal #<Class:UnboundMethodSpecs::Child3>
     [exec] 
     [exec] /home/travis/build/jruby/jruby/spec/ruby/core/unboundmethod/owner_spec.rb:24:in `block in (root)'
     [exec] org/jruby/RubyBasicObject.java:1711:in `instance_eval'
     [exec] org/jruby/RubyEnumerable.java:1596:in `all?'
     [exec] org/jruby/RubyFixnum.java:299:in `times'
     [exec] org/jruby/RubyArray.java:1734:in `each'
     [exec] /home/travis/build/jruby/jruby/spec/ruby/core/unboundmethod/owner_spec.rb:4:in `<main>'
```

partially reverts 07500f8
kares committed Jun 27, 2017
1 parent 07500f8 commit d3a5ee2
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
@@ -124,11 +124,4 @@ public long getSerialNumber() {
return oldMethod.getSerialNumber();
}

@Override
public RubyModule getDefinedClass() {
RubyModule definedClass = this.definedClass;
if (definedClass != null) return definedClass;
return oldMethod.getDefinedClass();
}

}
1 change: 1 addition & 0 deletions test/mri/excludes/TestMethod.rb
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
exclude :test_define_method_with_symbol, "scope changes in define_method methods?"
exclude :test_eq, "weird logic for != when patching an object retuned from o.method, likely irrelevant"
exclude :test_gced_bmethod, "often 'Timeout::Error: execution of assert_normal_exit expired' on CI"
exclude :test_inspect, "fails since an alias-ed method does not distinguish owner and implementor module"
exclude :test_hash, "won't pass since Array#map is not a Array#collect alias as in MRI"
exclude :test_orphan_callee, "needs investigation"
exclude :test_singleton_method, "needs investigation"

0 comments on commit d3a5ee2

Please sign in to comment.