Skip to content

Commit 937f891

Browse files
committed
Check for duplicate parameters in shared methods
1 parent 39669f2 commit 937f891

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

py/dml/traits.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ def mktrait(site, tname, ancestors, methods, params, sessions, hooks,
324324
bad_methods = set()
325325
for (name, (msite, inp, outp, throws, independent, startup, memoized, overridable,
326326
body, rbrace_site)) in list(methods.items()):
327+
argnames = set()
328+
for (pname, _) in inp:
329+
if pname in argnames:
330+
report(EARGD(msite, pname))
331+
bad_methods.add(name)
332+
argnames.add(pname)
327333
for ancestor in direct_parents:
328334
coll = ancestor.member_declaration(name)
329335
if coll:

0 commit comments

Comments
 (0)