From 52bcb15cf03d900f0da57cca7c2cb621b5aa0887 Mon Sep 17 00:00:00 2001 From: alandonovan Date: Fri, 13 Nov 2020 10:47:36 -0500 Subject: [PATCH] spec: duplicate keyword args f(x=1, x=2) is a static error (#133) This wording comes from https://github.com/google/starlark-go/commit/2c65f9e0f5e155edb22bcf767d709321069553e9 Fixes #21 --- spec.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec.md b/spec.md index 3cadfc5..a6f1d1e 100644 --- a/spec.md +++ b/spec.md @@ -944,6 +944,11 @@ Once the parameters have been successfully bound to the arguments supplied by the call, the sequence of statements that comprise the function body is executed. +It is a static error if a function call has two named arguments of the +same name, such as `f(x=1, x=2)`. A call that provides a `**kwargs` +argument may yet have two values for the same name, such as +`f(x=1, **dict(x=2))`. This results in a dynamic error. + Function arguments are evaluated in the order they appear in the call.