Ticket #1033 (new RFC)
no args checking for a sub without params
Reported by: | coke | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | imcc | Version: | trunk |
Severity: | medium | Keywords: | gci |
Cc: | whiteknight | Language: | |
Patch status: | Platform: |
Description
Originally reported in 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
Change History
Note: See
TracTickets for help on using
tickets.