Skip to content

Commit 769b571

Browse files
committed
anonymous functions can't have labelled arguments!
1 parent 3fb7658 commit 769b571

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
@@ -7729,11 +7729,12 @@ impl<'a> UnwrapAnonymousFunction<'a> {
77297729
for a in arguments {
77307730
match &a.names {
77317731
ArgNames::Named { name, .. } => outer_argument_names.push(name),
7732-
ArgNames::NamedLabelled { name, .. } => outer_argument_names.push(name),
7733-
// We can bail out early if any of these are discarded, since
7734-
// they couldn't match the arguments used.
7732+
// We can bail out early if any arguments are discarded, since
7733+
// they couldn't match those actually used.
77357734
ArgNames::Discard { .. } => return,
7736-
ArgNames::LabelledDiscard { .. } => return,
7735+
// Anonymous functions can't have labelled arguments.
7736+
ArgNames::NamedLabelled { .. } => unreachable!(),
7737+
ArgNames::LabelledDiscard { .. } => unreachable!(),
77377738
}
77387739
}
77397740

0 commit comments

Comments
 (0)