Ticket #1515 (new bug)
Duplicate named args cause fatal error in subs
Reported by: | Austin_Hastings | Owned by: | whiteknight |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | none | Version: | 2.2.0 |
Severity: | medium | Keywords: | |
Cc: | jkeenan | Language: | |
Patch status: | Platform: |
Description
Calling a sub with duplicate named args:
.sub main :main foo( 1 :named('a'), 2 :named('a') ) .end
triggers an error:
duplicate named argument in call current instr.: 'main' pc 0 (test.pir:4)
Unfortunately, this means that setting defaults in a hash, then flattening the hash together with any explicit named args, is no longer a valid way to handle argument defaulting. Given that, either (1) this is a bug, and duplicate named args should be permitted; or (2) this is the official new way, in which case what is the model for arg-defaulting?
Change History
Note: See
TracTickets for help on using
tickets.