Skip to content

Commit

Permalink
spec: duplicate keyword args f(x=1, x=2) is a static error (#133)
Browse files Browse the repository at this point in the history
This wording comes from google/starlark-go@2c65f9e

Fixes #21
  • Loading branch information
adonovan authored Nov 13, 2020
1 parent 05d58cf commit 52bcb15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<!-- see https://github.com/bazelbuild/starlark/issues/13 -->

Expand Down

0 comments on commit 52bcb15

Please sign in to comment.