Skip to content

Commit 8b43e4d

Browse files
committed
anonymous functions can't have labelled arguments!
1 parent cb1bb1c commit 8b43e4d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler-core/src/language_server/code_action.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8426,11 +8426,12 @@ impl<'a> UnwrapAnonymousFunction<'a> {
84268426
for a in arguments {
84278427
match &a.names {
84288428
ArgNames::Named { name, .. } => outer_argument_names.push(name),
8429-
ArgNames::NamedLabelled { name, .. } => outer_argument_names.push(name),
8430-
// We can bail out early if any of these are discarded, since
8431-
// they couldn't match the arguments used.
8429+
// We can bail out early if any arguments are discarded, since
8430+
// they couldn't match those actually used.
84328431
ArgNames::Discard { .. } => return,
8433-
ArgNames::LabelledDiscard { .. } => return,
8432+
// Anonymous functions can't have labelled arguments.
8433+
ArgNames::NamedLabelled { .. } => unreachable!(),
8434+
ArgNames::LabelledDiscard { .. } => unreachable!(),
84348435
}
84358436
}
84368437

0 commit comments

Comments
 (0)