Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (631 Bytes)
Bug #18569
ยป disasm.rb
Script to reproduce the problem -
GabrielMalakias (Gabriel Malaquias)
, 02/03/2022 10:39 AM
puts
"Ruby version:
#{
RUBY_VERSION
}
"
first_proc
=
proc
{
|
x
|
x
+
2
}
second_proc
=
proc
{
|
x
|
x
+
3
}
# works
puts
first_proc
.
class
puts
"proc { |x| x + 2 }"
puts
RubyVM
::
InstructionSequence
.
disasm
(
first_proc
)
puts
"-------------------------------------"
# works
puts
second_proc
.
class
puts
"proc { |x| x + 3 }"
puts
RubyVM
::
InstructionSequence
.
disasm
(
second_proc
)
puts
"-------------------------------------"
composed_function
=
first_proc
>>
second_proc
# unexpected result
puts
composed_function
.
class
puts
"proc { |x| x + 2 } >> proc { |x| x + 3 } returns nil??"
puts
RubyVM
::
InstructionSequence
.
disasm
(
composed_function
)
(1-1/1)
Loading...