Skip to content

Commit

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

Fixes bazelbuild#21

Change-Id: I545111904f25fc0764633f55c5f887706123b0bc
  • Loading branch information
adonovan committed Nov 13, 2020
1 parent 7d8ff9c commit 4c116d7
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 @@ -942,6 +942,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 4c116d7

Please sign in to comment.