-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Pick PR #58514 (Fixed a regression with reporting u...) into releas…
…e-5.5 (#58841) Co-authored-by: Mateusz Burzyński <[email protected]>
- Loading branch information
Showing
5 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/noUnusedLocals_potentialPredicateUnusedParam.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
noUnusedLocals_potentialPredicateUnusedParam.ts(1,40): error TS6133: 'a' is declared but its value is never read. | ||
|
||
|
||
==== noUnusedLocals_potentialPredicateUnusedParam.ts (1 errors) ==== | ||
function potentialPredicateUnusedParam(a: unknown) { | ||
~ | ||
!!! error TS6133: 'a' is declared but its value is never read. | ||
return !!Math.random(); | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/noUnusedLocals_potentialPredicateUnusedParam.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//// [tests/cases/compiler/noUnusedLocals_potentialPredicateUnusedParam.ts] //// | ||
|
||
=== noUnusedLocals_potentialPredicateUnusedParam.ts === | ||
function potentialPredicateUnusedParam(a: unknown) { | ||
>potentialPredicateUnusedParam : Symbol(potentialPredicateUnusedParam, Decl(noUnusedLocals_potentialPredicateUnusedParam.ts, 0, 0)) | ||
>a : Symbol(a, Decl(noUnusedLocals_potentialPredicateUnusedParam.ts, 0, 39)) | ||
|
||
return !!Math.random(); | ||
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) | ||
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
tests/baselines/reference/noUnusedLocals_potentialPredicateUnusedParam.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//// [tests/cases/compiler/noUnusedLocals_potentialPredicateUnusedParam.ts] //// | ||
|
||
=== noUnusedLocals_potentialPredicateUnusedParam.ts === | ||
function potentialPredicateUnusedParam(a: unknown) { | ||
>potentialPredicateUnusedParam : (a: unknown) => boolean | ||
> : ^ ^^ ^^^^^^^^^^^^ | ||
>a : unknown | ||
> : ^^^^^^^ | ||
|
||
return !!Math.random(); | ||
>!!Math.random() : boolean | ||
> : ^^^^^^^ | ||
>!Math.random() : boolean | ||
> : ^^^^^^^ | ||
>Math.random() : number | ||
> : ^^^^^^ | ||
>Math.random : () => number | ||
> : ^^^^^^ | ||
>Math : Math | ||
> : ^^^^ | ||
>random : () => number | ||
> : ^^^^^^ | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
tests/cases/compiler/noUnusedLocals_potentialPredicateUnusedParam.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// @strict: true | ||
// @noEmit: true | ||
// @noUnusedLocals: true | ||
// @noUnusedParameters: true | ||
|
||
function potentialPredicateUnusedParam(a: unknown) { | ||
return !!Math.random(); | ||
} |