Overview
Artifact ID: | 3383e3f7c92f3d5883f90cadf67da2d16b5fa6a3 |
---|---|
Ticket: | 35fdc88036489d43b4dd1b326527dc0bd7762bf7
proc: disallow duplicated parameter names in arg spec |
User & Date: | mr_calvin 2017-02-23 12:52:19 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
% proc foo {a a a} {return [concat [info local] $a]}; foo 1 2 3 a a a 1 To quote KBK from IRC yesterday :) "Arguably, that's a bug. It surely doesn't do anything useful, and we probably should detect it as an error." "The fact that Tcl has been around for 27 years, and nobody's noticed [proc x {a a a} { ... }] until now indicates that it's low-worry, especially if it doesn't cause a crash. (I expect that it'll just discard the first two args at run time.)" Low-worry, indeed, but potentially irritating ([info]) and kind of puzzling after so many years. In the attached patch, I gave it a shot. Tests were added to proc.test, two tests fixed in trace.test (actually using repeated names!). The above one liner will now result in a proper TCL_ERROR: arg list contains a duplicate entry "a" Stefan
- foundin changed to: "8.7a0"
- is_private changed to: "0"
- login: "mr_calvin"
- priority changed to: "5 Medium"
- private_contact changed to: "d4d1d8192a46acf2c7d58cddc1040ecdbc9c9d77"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "mr_calvin"
- subsystem changed to: "22. [proc] and [uplevel]"
- title changed to:
proc: disallow duplicated parameter names in arg spec
- type changed to: "Patch"