% 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