File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
crates/oxc_linter/src/rules/eslint/no_unused_vars Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,15 @@ fn test_vars_discarded_reads() {
236236 }
237237 foo(1)
238238 " ,
239+ // https://github.com/oxc-project/oxc/issues/10806
240+ "export function f1(fn: () => Promise<void>) {
241+ return async () => (await fn(), 1)
242+ }" ,
243+ "export function f2(fn: () => Promise<void>) {
244+ return function* () {
245+ return (yield fn(), 1);
246+ }
247+ }" ,
239248 ] ;
240249
241250 let fail = vec ! [
Original file line number Diff line number Diff line change @@ -607,9 +607,15 @@ impl<'a> Symbol<'_, 'a> {
607607 }
608608 }
609609 ( parent, AstKind :: SequenceExpression ( seq) ) => {
610- if matches ! ( parent, AstKind :: CallExpression ( _) ) {
610+ if matches ! (
611+ parent,
612+ AstKind :: CallExpression ( _)
613+ | AstKind :: AwaitExpression ( _)
614+ | AstKind :: YieldExpression ( _)
615+ ) {
611616 continue ;
612617 }
618+
613619 debug_assert ! (
614620 !seq. expressions. is_empty( ) ,
615621 "empty SequenceExpressions should be a parse error."
You can’t perform that action at this time.
0 commit comments