-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refinement with super
vs. inheritance
#5221
Milestone
Comments
This means that you can't refine Numeric for example:- module SuperNumeric
refine Numeric do
def degrees
self * 57.29577951308232
end
def radians
self * 0.017453292519943295
end
end
end
using SuperNumeric
puts 45.radians
puts 0.7853981634.degrees mri ruby:- 0.7853981633974483
45.0000000001462 jruby (9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11 +jit [linux-x86_64]) NoMethodError: undefined method `radians' for 45:Integer
<main> at numeric.rb:15 |
Closed
english
added a commit
to english/rspec-generators
that referenced
this issue
Jan 18, 2019
it doesn't seem to support refinements that use inheritence, see jruby/jruby#5221
Both PRs and additional fixes have been merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Expected Behavior
The code below print
"foo-o-o"
(as in CRuby):Actual Behavior
It doesn't activate the refinement and prints
"foo"
.When calling on a
A
class instance works as expected:The text was updated successfully, but these errors were encountered: