Closed yuxincs closed 1 year ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
CLA is now cleared so this PR is good to go 😃
*syntax.DictExpr
has a fieldList []Expr
which is supposed to only contain*syntax.DictEntry
s:https://github.com/google/starlark-go/blob/d7da88764354917a82dfa84a8ae1cb04f107ab78/syntax/syntax.go#L377
However, when we are walking
*syntax.DictExpr
node insyntax.Walk
function, we are ignoring*syntax.DictEntry
s, directly unwrapping it, and then continuing the walk recursions. This means the caller will not be able to "see" a*syntax.DictEntry
node when calling the walk function.This PR fixes this by directly walking on each element of the
List
field, which in turn will be automatically handled by the*syntax.DictEntry
case inWalk
.