Skip to content

Calling inspect on proc resets line in source_location #9110

@katafrakt

Description

@katafrakt

Environment Information

  • jruby 10.0.3.0-SNAPSHOT (3.4.5) 2025-12-03 26970e34c5 OpenJDK 64-Bit Server VM 21.0.9+10 on 21.0.9+10 +indy +jit [x86_64-linux], but also happens on jruby 10.0.2.0 (3.4.2) 2025-08-07 cba6031bd0 OpenJDK 64-Bit Server VM 21.0.9+10 on 21.0.9+10 +indy +jit [x86_64-linux]).
  • Linux burza 6.17.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 24 Nov 2025 15:21:09 +0000 x86_64 GNU/Linux

Reproduction script:

pr = proc { "foo" }
p pr.source_location
pr.inspect
p pr.source_location

Expected Behavior

Calling inspect or to_s should not affect the proc object. Both source_location calls return the same.

Actual Behavior

The line part of source_location changes to 0:

["/tmp/proc_test.rb", 1]
["/tmp/proc_test.rb", 0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions