#1033: no args checking for a sub without params
--------------------+-------------------------------------------------------
 Reporter:  coke    |       Owner:       
     Type:  RFC     |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  none    |     Version:  trunk
 Severity:  medium  |    Keywords:       
     Lang:          |       Patch:       
 Platform:          |  
--------------------+-------------------------------------------------------
 Originally reported in
 [http://rt.perl.org/rt3/Ticket/Display.html?id=39844 RT].

 If no .params are given, no args checking is done on sub invocation.  From
 the original:

 {{{
 On Sat Jul 15 23:29:10 2006, mdiep wrote:
 > I expect this to die with a "too many args" error, but it doesn't --
 > it prints "ok":
 >
 > .sub main :main
 > test("foo", "bar")
 > end
 > .end
 >
 > .sub test
 > print "ok\n"
 > .return()
 > .end
 >
 > --
 > Matt Diephouse
 >
 }}}

 2 sample patches to achieve this (both of which are declared to fail) are
 attached to the original ticket. Neither apply cleanly to trunk.

 There is a question, however, as to whether or not the existing behavior
 is desirable - should we always check args? should we always check except
 for :main? (should we check for :main too and suggest that the programmer
 use .param args :slurpy to avoid any issues?)

 There's a test already committed in t/op/calling.t

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1033>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to