Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/expressions.rs')
-rw-r--r--crates/parser/src/grammar/expressions.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs
index 1cbd166323..8542d6b86b 100644
--- a/crates/parser/src/grammar/expressions.rs
+++ b/crates/parser/src/grammar/expressions.rs
@@ -693,6 +693,17 @@ pub(crate) fn record_expr_field_list(p: &mut Parser<'_>) {
// We permit `.. }` on the left-hand side of a destructuring assignment.
if !p.at(T!['}']) {
expr(p);
+
+ if p.at(T![,]) {
+ // test_err comma_after_functional_update_syntax
+ // fn foo() {
+ // S { ..x, };
+ // S { ..x, a: 0 }
+ // }
+
+ // Do not bump, so we can support additional fields after this comma.
+ p.error("cannot use a comma after the base struct");
+ }
}
}
T!['{'] => {