-
Notifications
You must be signed in to change notification settings - Fork 595
Closed
Description
- What command did you run?
I ran ruby rbx_strftime.rb, where rbx_strftime.rb is the following:
module Extension
def strftime(format)
super('%Y')
end
end
class ExtendedTime < Time
include Extension
end
class ExtendedTime2 < Time
include Extension
end
class TestClass
def strftime(format)
"TestClass: #{format}"
end
end
class ExtendedTestClass < TestClass
include Extension
end
puts ExtendedTime.new(2018).strftime('x')
puts ExtendedTime2.new(2018).strftime('x')
3.times { puts ExtendedTestClass.new.strftime('x') }- What behavior did you expect?
I expected the following output:
2018
2018
TestClass: %Y
TestClass: %Y
TestClass: %Y
- What behavior did you get instead?
The third execution of puts ExtendedTestClass.new.strftime('x') resulted in a PrimitiveFailure exception being raised instead of the output of the last TestClass: %Y line (see https://gist.github.com/philr/b22784c46411a5b79dc53e57011f80f2#file-rbx_strftime_output-txt). The stack trace appears to indicate that the super call in Extension#strftime invoked Time#strftime instead of the expected TestClass#strftime.
- What version of Rubinius?
3.93
Output of rbx -v:
rubinius 3.93 (2.3.1 75512369 2018-01-20 4.0.0) [x86_64-linux-gnu]
- What version of operating system?
Ubuntu 17.04 (x86_64)
Output of uname -a:
Linux linuxdev 4.10.0-42-generic #46-Ubuntu SMP Mon Dec 4 14:38:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- What is your operating system distribution, if your operating system has more than one?
Ubuntu 17.04
- How did you build your version of Rubinius?
- I used RVM.
- I used ruby-build.
- I used ruby-install.
- I built manually from a tarball.
- I built manually from a git clone.
- I installed a binary.
- Does this issue involve proprietary code?
- Yes, this issue involves proprietary code that I cannot share.
- Yes, this issue involves proprietary code, but I am able to share it under certain conditions.
- No, this issue doesn't involve proprietary code.
- Are you able to help us debug the issue?
- Yes, I'm able to help debug, including running commands under lldb.
- No, I'm not able help debug or I don't have time to help.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels