[1.9] Star and unnamed restarg treated differently in 1.9 mode Proc#parameters
------------------------------------------------------------------------------

                 Key: JRUBY-5368
                 URL: http://jira.codehaus.org/browse/JRUBY-5368
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Parser, Ruby 1.9
    Affects Versions: JRuby 1.6RC1
            Reporter: Charles Oliver Nutter
            Assignee: Thomas E Enebo
             Fix For: JRuby 1.6RC2


Discovered this when working on JRUBY-5358:

{noformat}
~/projects/rubyspec ➔ ruby -v -e "p lambda {|a,|}.parameters"
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
[[:req, :a]]

~/projects/rubyspec ➔ ruby -v -e "p lambda {|a,*|}.parameters"
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
[[:req, :a], [:rest]]

~/projects/rubyspec ➔ ../jruby/bin/jruby --1.9 -v -e "p lambda 
{|a,|}.parameters"
jruby 1.6.0.RC1 (ruby 1.9.2 patchlevel 136) (2011-01-15 3e98f87) (Java 
HotSpot(TM) 64-Bit Server VM 1.6.0_22) [darwin-x86_64-java]
[[:req, :a]]

~/projects/rubyspec ➔ ../jruby/bin/jruby --1.9 -v -e "p lambda 
{|a,*|}.parameters"
jruby 1.6.0.RC1 (ruby 1.9.2 patchlevel 136) (2011-01-15 3e98f87) (Java 
HotSpot(TM) 64-Bit Server VM 1.6.0_22) [darwin-x86_64-java]
[[:req, :a]]
{noformat}

The parser currently does not produce different nodes for these two cases, so 
it's impossible to modify Proc#parameters to handle this properly.

RubySpec added:

commit aad38981bbd18996b8c82c58b10ce286535c989a
Author: Charles Oliver Nutter <head...@headius.com>
Date:   Sun Jan 16 17:07:44 2011 -0600

    Add specs for Proc#parameters with both styles of anonymous restarg.


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