File tree Expand file tree Collapse file tree
tests/syntax_tests/data/parsing/errors/other Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131#### :nail_care : Polish
3232
3333- Add (dev-)dependencies to build schema. https://github.com/rescript-lang/rescript/pull/7892
34+ - Dedicated error for dict literal spreads. https://github.com/rescript-lang/rescript/pull/7901
3435
3536#### :house : Internal
3637
Original file line number Diff line number Diff line change @@ -3373,6 +3373,7 @@ and parse_dict_expr_row p =
33733373 | DotDotDot ->
33743374 Parser. err p (Diagnostics. message ErrorMessages. dict_expr_spread);
33753375 Parser. next p;
3376+ (* Parse the expr so it's consumed *)
33763377 let _spread_expr = parse_constrained_or_coerced_expr p in
33773378 None
33783379 | String s -> (
Original file line number Diff line number Diff line change 1- let x = dict {... foo }
1+ let x = dict {... foo , "bar" : 3 }
22
Original file line number Diff line number Diff line change 22 Syntax error!
33 syntax_tests/data/parsing/errors/other/dict_spread.res:1:14-16
44
5- 1 │ let x = dict{...foo}
5+ 1 │ let x = dict{...foo, "bar": 3 }
66 2 │
77 3 │
88
99 Dict literals do not support spread (`...`) yet.
1010
11- let x = Primitive_dict.make [||]
11+ let x = Primitive_dict.make [|("bar", 3) |]
You can’t perform that action at this time.
0 commit comments