jruby could warn more
---------------------

                 Key: JRUBY-5536
                 URL: http://jira.codehaus.org/browse/JRUBY-5536
             Project: JRuby
          Issue Type: Improvement
         Environment: jruby 1.6.0.RC2 (ruby 1.8.7 patchlevel 330) (2011-02-22 
698a5e3) (Java HotSpot(TM) Client VM 1.6.0_18) [Windows 7-x86-java]
            Reporter: Roger Pack
            Assignee: Thomas E Enebo


With this code, 

{noformat}
#old_das = File.read('children.xml').scan(/dgs:(\d{9})/).map &:first
unaccounted = old_das -das
{noformat}

jruby -v outputs "syntax_warnings.rb:2 warning: Ambiguous first argument; make 
sure." (MRI's warning is a bit different: "syntax_warnings.rb:2: warning: 
ambiguous first argument; put parentheses or even spaces" which may be clearer).

And with this code:
{noformat}
old_das = File.read('children.xml').scan(/dgs:(\d{9})/).map( &:first)
unaccounted = old_das -das
{noformat}

MRI outputs:
C:\dev\2.4\preservation\prestapedb>ruby -vc syntax_warnings.rb
ruby 1.9.2p136 (2010-12-25) [i386-mingw32]
syntax_warnings.rb:2: warning: `-' after local variable is interpreted as 
binary operator
syntax_warnings.rb:2: warning: even though it seems like unary operator
Syntax OK

and jruby outputs no warnings at all, which may not have been expected.

Cheers!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to