1.2RC1 case - when clause evaluation does not short-circuit
-----------------------------------------------------------

                 Key: JRUBY-3455
                 URL: http://jira.codehaus.org/browse/JRUBY-3455
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.2
         Environment: Linux tadubuntu 2.6.27-11-generic #1 SMP Thu Jan 29 
19:28:32 UTC 2009 x86_64 GNU/Linux
--
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6.1) Runtime Environment (build 1.6.0_0-b12)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)
--
jruby 1.2.0RC1 (ruby 1.8.6 patchlevel 287) (2009-02-27 rev 6586) [amd64-java]
            Reporter: Darshan Shaligram
            Assignee: Thomas E Enebo


JRuby 1.2RC1 does not seem to short circuit evaluation of multiple alternative 
when expressions:

jruby 1.2.0RC1 (ruby 1.8.6 patchlevel 287) (2009-02-27 rev 6586) [amd64-java]

irb(main):001:0>  c = nil; case ; when c.nil?, 0 < c; puts "YES"; end
ArgumentError: comparison of Fixnum with nil failed
        from (irb):2

c.nil? is true, so 0 < c should not be evaluated.

In contrast:
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
irb(main):001:0> c = nil; case ; when c.nil?, 0 < c; puts "YES"; end
YES
=> nil


-- 
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