diff --git a/lib/irb/source_finder.rb b/lib/irb/source_finder.rb index 5d7d729d1..c515da570 100644 --- a/lib/irb/source_finder.rb +++ b/lib/irb/source_finder.rb @@ -100,7 +100,7 @@ def find_source(signature, super_level = 0) Source.new(file, line) elsif method # Method defined with eval, probably in IRB session - source = RubyVM::AbstractSyntaxTree.of(method)&.source rescue nil + source = RubyVM::InstructionSequence.of(method)&.script_lines&.join rescue nil Source.new(file, line, source) end rescue EvaluationError