diff --git a/compiler/ksp_compiler.py b/compiler/ksp_compiler.py index 714a1de..00d0795 100644 --- a/compiler/ksp_compiler.py +++ b/compiler/ksp_compiler.py @@ -900,6 +900,10 @@ def modifyFunctionDef(self, node, parent_function = None, function_params = None node.locals = set() # a set containing the keys in node.locals_name_subst_dict, but all in lowercase node.used = False + # verify that there are no duplicate argument names in the function definition + if len(set(node.parameters)) > 0: + raise ksp_ast.ParseException(node, "Function contains duplicate argument names!") + # as we visit the function definition, pass along information to nodes further down the tree of the function parameter names params = function_params + node.parameters