Issue #7559 has been reported by naruse (Yui NARUSE).

----------------------------------------
Bug #7559: Wrong line number with method call syntax
https://bugs.ruby-lang.org/issues/7559

Author: naruse (Yui NARUSE)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-13 trunk 38361) [x86_64-freebsd9.0]


以下のような場合に表示される行数がおかしくなります。

def foo(*args)
  p caller[0][/\d+/].to_i #=> expected 4 but 8
end
foo "a
b
c
d
e"

def bar(a, b, line)
p a
  p line #=> expected 14 but 19
end
def baz
  bar __LINE__, <<eom, __LINE__
    a
    b
    c
    d
eom
end
baz


-- 
http://bugs.ruby-lang.org/