From: Charlton Wang Date: 2012-01-26T14:15:25+09:00 Subject: [ruby-core:42232] [ruby-trunk - Bug #5930][Open] source_location of blocks incorrect Issue #5930 has been reported by Charlton Wang. ---------------------------------------- Bug #5930: source_location of blocks incorrect https://bugs.ruby-lang.org/issues/5930 Author: Charlton Wang Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 1.9.2-p136 and newer Similar to bug #2427 but maybe the opposite problem. Newer versions of ruby appear to store the source locations of blocks incorrectly when passed as an argument to a multi-line invocation of a function. Snippet of code below reveals the problem: ----- def foo(*args, &block) p block.source_location end foo(1, 2, 3) do end ----- Under ruby 1.9.1-p243: ["-", 8] Under ruby 1.9.2-p136 and newer: ["-", 5] It seems with newer versions of ruby, it reports it based on the line on which the function is called instead of where the actual block is. I believe the old behaviour is actually the correct behaviour. Charlton -- http://bugs.ruby-lang.org/