Skip to content

Commit

Permalink
Fix #9402: Do not report unused identifier errors for catch variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed Jun 28, 2016
1 parent 67f0ffe commit 17a428c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/compiler/checker.ts
Expand Up @@ -15563,7 +15563,6 @@ namespace ts {
}

checkBlock(catchClause.block);
checkUnusedIdentifiers(catchClause);
}

if (node.finallyBlock) {
Expand Down
10 changes: 0 additions & 10 deletions tests/baselines/reference/unusedParameterInCatchClause.errors.txt

This file was deleted.

@@ -0,0 +1,8 @@
=== tests/cases/compiler/unusedParameterInCatchClause.ts ===

function f1() {
>f1 : Symbol(f1, Decl(unusedParameterInCatchClause.ts, 0, 0))

try {} catch(ex){}
>ex : Symbol(ex, Decl(unusedParameterInCatchClause.ts, 2, 17))
}
8 changes: 8 additions & 0 deletions tests/baselines/reference/unusedParameterInCatchClause.types
@@ -0,0 +1,8 @@
=== tests/cases/compiler/unusedParameterInCatchClause.ts ===

function f1() {
>f1 : () => void

try {} catch(ex){}
>ex : any
}

0 comments on commit 17a428c

Please sign in to comment.