[1.8] Problem defining method with default parameter in first position
----------------------------------------------------------------------
Key: JRUBY-4851
URL: http://jira.codehaus.org/browse/JRUBY-4851
Project: JRuby
Issue Type: Bug
Components: Interpreter
Affects Versions: JRuby 1.5
Environment: WinXp (untested elsewhere)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
Reporter: Robert Brown
Problem defining method with default param in first position. Seems OK for
1.9. See below:
C:\>jruby --1.9 -S jirb
irb(main):001:0> def qtest(a="foo",b);puts "hello";end;qtest(1,2)
hello
=> nil
irb(main):002:0> exit
C:\>jruby -S jirb
irb(main):001:0> def qtest(a="foo",b);puts "hello";end;qtest(1,2)
SyntaxError: (irb):1: syntax error, unexpected tRPAREN
def qtest(a="foo",b);puts "hello";end;qtest(1,2)
^
from (irb):1
irb(main):002:0> def qtest(a,b);puts "hello";end;qtest(1,2)
hello
=> nil
irb(main):003:0> def qtest(a,b="bar");puts "hello";end;qtest(1,2)
hello
=> nil
irb(main):004:0> def qtest(a="foo",b="bar");puts "hello";end;qtest(1,2)
hello
=> nil
irb(main):005:0> def qtest(a="foo",b);puts "hello";end;qtest(1,2)
SyntaxError: (irb):5: syntax error, unexpected tRPAREN
def qtest(a="foo",b);puts "hello";end;qtest(1,2)
^
from (irb):5
--
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