Skip to content

Commit 17a428c

Browse files
committed
Fix microsoft#9402: Do not report unused identifier errors for catch variables
1 parent 67f0ffe commit 17a428c

4 files changed

Lines changed: 16 additions & 11 deletions

File tree

src/compiler/checker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15563,7 +15563,6 @@ namespace ts {
1556315563
}
1556415564

1556515565
checkBlock(catchClause.block);
15566-
checkUnusedIdentifiers(catchClause);
1556715566
}
1556815567

1556915568
if (node.finallyBlock) {

tests/baselines/reference/unusedParameterInCatchClause.errors.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=== tests/cases/compiler/unusedParameterInCatchClause.ts ===
2+
3+
function f1() {
4+
>f1 : Symbol(f1, Decl(unusedParameterInCatchClause.ts, 0, 0))
5+
6+
try {} catch(ex){}
7+
>ex : Symbol(ex, Decl(unusedParameterInCatchClause.ts, 2, 17))
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=== tests/cases/compiler/unusedParameterInCatchClause.ts ===
2+
3+
function f1() {
4+
>f1 : () => void
5+
6+
try {} catch(ex){}
7+
>ex : any
8+
}

0 commit comments

Comments
 (0)