Forum: Ruby-core [ruby-trunk - Bug #8140][Open] Incorrect warning: `+' after local variable is interpreted as binary

Posted by glyn (Glyn Normington) (Guest)
on 2013-03-21 16:20
(Received via mailing list)
Issue #8140 has been reported by glyn (Glyn Normington).

----------------------------------------
Bug #8140: Incorrect warning: `+' after local variable is interpreted as 
binary operator
https://bugs.ruby-lang.org/issues/8140

Author: glyn (Glyn Normington)
Status: Open
Priority: Low
Assignee: matz (Yukihiro Matsumoto)
Category: syntax
Target version:
ruby -v: ruby 1.9.3p374 (2013-01-15 revision 38858) 
[x86_64-darwin12.2.1]


The statement:

puts '' +''

generates an invalid warning when executed with "ruby -w" which (a) 
implies a syntactical ambiguity where there is none, and (b) refers to a 
"local variable" of which there are none.

Note that:

puts ''+''

and:

puts '' + ''

produce no warnings.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.