Wrong evaluation of default parameters
--------------------------------------
Key: JRUBY-949
URL: http://jira.codehaus.org/browse/JRUBY-949
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.0.0RC2
Environment: fresh JRuby build, Linux
Reporter: Martin Krauskopf
Or at least different to MRI. Try the "known" trick to find out whether default
parameter was passed.
{code}
def m(a, b=(def_passed=true; 0))
puts "==="
puts " a: #{a}"
puts " b: #{b}"
puts " def_passed: #{def_passed.inspect}"
end
m(1)
m(1, 0)
m(1, 1)
{code}
--
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