Skip to content

Commit 88e3c83

Browse files
committed
Fix comment
1 parent f4363c8 commit 88e3c83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/ast/asdl_rs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ def visitField(self, field, parent, vis, depth, constructor=None):
241241
if fieldtype and fieldtype.boxed and (not (parent.product or field.seq) or field.opt):
242242
typ = f"Box<{typ}>"
243243
if field.opt or (
244-
# Add `Option` to allow `Dict.keys` to contain `None` for dictionary unpacking
245-
# in a dict literal.
244+
# When a dictionary literal contains dictionary unpacking (e.g., `{**d}`),
245+
# the expression to be unpacked goes in `values` with a `None` at the corresponding
246+
# position in `keys`. To handle this, the type of `keys` needs to be `Option<Vec<T>>`.
246247
constructor == "Dict" and field.name == "keys"
247248
):
248249
typ = f"Option<{typ}>"

0 commit comments

Comments
 (0)