Skip to content
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

Proc source location gives wrong result #5286

enebo opened this issue Aug 21, 2018 · 0 comments

Proc source location gives wrong result #5286

enebo opened this issue Aug 21, 2018 · 0 comments


Copy link

@enebo enebo commented Aug 21, 2018

Originally reported by @jmalves in PR #5262


Ruby version: jruby (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.152-b16 on 1.8.0_152-b16 +jit [darwin-x86_64]
OS/platform: macOS 10.13.5

Expected Behavior

On ruby 2.5.0 and jruby- the following script:

expected = LINE + 1
proc = do


p "#{expected} == #{proc.source_location[1]}"

Prints: 2 == 2
Actual Behavior

On jruby- it prints 2 == 5

I found this bug by noticing that rspec with line filters (e.g. rspec test_file.rb:20) was not working.

I traced this back to ca25471

I am doubtful that the fix I proposed in this PR is adequate but anyway it was fun to look around this.

Tested with fast specs, mri's test_lambda and test_proc. No spec failures were added but also none were fixed :X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant