-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unused type parameters should be checked by --noUnusedParameters, not (…
- Loading branch information
1 parent
9677b06
commit f0ba16c
Showing
25 changed files
with
283 additions
and
19 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
33 changes: 33 additions & 0 deletions
33
tests/baselines/reference/unusedTypeParametersCheckedByNoUnusedParameters.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,33 @@ | ||
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts(1,12): error TS6133: 'T' is declared but its value is never read. | ||
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts(3,8): error TS6133: 'T' is declared but its value is never read. | ||
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts(5,13): error TS6133: 'T' is declared but its value is never read. | ||
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts(7,9): error TS6133: 'T' is declared but its value is never read. | ||
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts(8,14): error TS6133: 'V' is declared but its value is never read. | ||
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts(11,10): error TS6133: 'T' is declared but its value is never read. | ||
|
||
|
||
==== tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts (6 errors) ==== | ||
function f<T>() { } | ||
~ | ||
!!! error TS6133: 'T' is declared but its value is never read. | ||
|
||
type T<T> = { }; | ||
~ | ||
!!! error TS6133: 'T' is declared but its value is never read. | ||
|
||
interface I<T> { }; | ||
~ | ||
!!! error TS6133: 'T' is declared but its value is never read. | ||
|
||
class C<T> { | ||
~ | ||
!!! error TS6133: 'T' is declared but its value is never read. | ||
public m<V>() { } | ||
~ | ||
!!! error TS6133: 'V' is declared but its value is never read. | ||
}; | ||
|
||
let l = <T>() => { }; | ||
~ | ||
!!! error TS6133: 'T' is declared but its value is never read. | ||
|
25 changes: 25 additions & 0 deletions
25
tests/baselines/reference/unusedTypeParametersCheckedByNoUnusedParameters.js
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,25 @@ | ||
//// [unusedTypeParametersCheckedByNoUnusedParameters.ts] | ||
function f<T>() { } | ||
|
||
type T<T> = { }; | ||
|
||
interface I<T> { }; | ||
|
||
class C<T> { | ||
public m<V>() { } | ||
}; | ||
|
||
let l = <T>() => { }; | ||
|
||
|
||
//// [unusedTypeParametersCheckedByNoUnusedParameters.js] | ||
function f() { } | ||
; | ||
var C = /** @class */ (function () { | ||
function C() { | ||
} | ||
C.prototype.m = function () { }; | ||
return C; | ||
}()); | ||
; | ||
var l = function () { }; |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/unusedTypeParametersCheckedByNoUnusedParameters.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,27 @@ | ||
=== tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts === | ||
function f<T>() { } | ||
>f : Symbol(f, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 0, 0)) | ||
>T : Symbol(T, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 0, 11)) | ||
|
||
type T<T> = { }; | ||
>T : Symbol(T, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 0, 19)) | ||
>T : Symbol(T, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 2, 7)) | ||
|
||
interface I<T> { }; | ||
>I : Symbol(I, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 2, 16)) | ||
>T : Symbol(T, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 4, 12)) | ||
|
||
class C<T> { | ||
>C : Symbol(C, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 4, 19)) | ||
>T : Symbol(T, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 6, 8)) | ||
|
||
public m<V>() { } | ||
>m : Symbol(C.m, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 6, 12)) | ||
>V : Symbol(V, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 7, 13)) | ||
|
||
}; | ||
|
||
let l = <T>() => { }; | ||
>l : Symbol(l, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 10, 3)) | ||
>T : Symbol(T, Decl(unusedTypeParametersCheckedByNoUnusedParameters.ts, 10, 9)) | ||
|
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/unusedTypeParametersCheckedByNoUnusedParameters.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,28 @@ | ||
=== tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.ts === | ||
function f<T>() { } | ||
>f : <T>() => void | ||
>T : T | ||
|
||
type T<T> = { }; | ||
>T : {} | ||
>T : T | ||
|
||
interface I<T> { }; | ||
>I : I<T> | ||
>T : T | ||
|
||
class C<T> { | ||
>C : C<T> | ||
>T : T | ||
|
||
public m<V>() { } | ||
>m : <V>() => void | ||
>V : V | ||
|
||
}; | ||
|
||
let l = <T>() => { }; | ||
>l : <T>() => void | ||
><T>() => { } : <T>() => void | ||
>T : T | ||
|
25 changes: 25 additions & 0 deletions
25
tests/baselines/reference/unusedTypeParametersNotCheckedByNoUnusedLocals.js
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,25 @@ | ||
//// [unusedTypeParametersNotCheckedByNoUnusedLocals.ts] | ||
function f<T>() { } | ||
|
||
type T<T> = { }; | ||
|
||
interface I<T> { }; | ||
|
||
class C<T> { | ||
public m<V>() { } | ||
}; | ||
|
||
let l = <T>() => { }; | ||
|
||
|
||
//// [unusedTypeParametersNotCheckedByNoUnusedLocals.js] | ||
function f() { } | ||
; | ||
var C = /** @class */ (function () { | ||
function C() { | ||
} | ||
C.prototype.m = function () { }; | ||
return C; | ||
}()); | ||
; | ||
var l = function () { }; |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/unusedTypeParametersNotCheckedByNoUnusedLocals.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,27 @@ | ||
=== tests/cases/compiler/unusedTypeParametersNotCheckedByNoUnusedLocals.ts === | ||
function f<T>() { } | ||
>f : Symbol(f, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 0, 0)) | ||
>T : Symbol(T, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 0, 11)) | ||
|
||
type T<T> = { }; | ||
>T : Symbol(T, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 0, 19)) | ||
>T : Symbol(T, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 2, 7)) | ||
|
||
interface I<T> { }; | ||
>I : Symbol(I, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 2, 16)) | ||
>T : Symbol(T, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 4, 12)) | ||
|
||
class C<T> { | ||
>C : Symbol(C, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 4, 19)) | ||
>T : Symbol(T, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 6, 8)) | ||
|
||
public m<V>() { } | ||
>m : Symbol(C.m, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 6, 12)) | ||
>V : Symbol(V, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 7, 13)) | ||
|
||
}; | ||
|
||
let l = <T>() => { }; | ||
>l : Symbol(l, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 10, 3)) | ||
>T : Symbol(T, Decl(unusedTypeParametersNotCheckedByNoUnusedLocals.ts, 10, 9)) | ||
|
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/unusedTypeParametersNotCheckedByNoUnusedLocals.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,28 @@ | ||
=== tests/cases/compiler/unusedTypeParametersNotCheckedByNoUnusedLocals.ts === | ||
function f<T>() { } | ||
>f : <T>() => void | ||
>T : T | ||
|
||
type T<T> = { }; | ||
>T : {} | ||
>T : T | ||
|
||
interface I<T> { }; | ||
>I : I<T> | ||
>T : T | ||
|
||
class C<T> { | ||
>C : C<T> | ||
>T : T | ||
|
||
public m<V>() { } | ||
>m : <V>() => void | ||
>V : V | ||
|
||
}; | ||
|
||
let l = <T>() => { }; | ||
>l : <T>() => void | ||
><T>() => { } : <T>() => void | ||
>T : T | ||
|
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
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
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
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
13 changes: 13 additions & 0 deletions
13
tests/cases/compiler/unusedTypeParametersCheckedByNoUnusedParameters.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,13 @@ | ||
//@noUnusedParameters:true | ||
|
||
function f<T>() { } | ||
|
||
type T<T> = { }; | ||
|
||
interface I<T> { }; | ||
|
||
class C<T> { | ||
public m<V>() { } | ||
}; | ||
|
||
let l = <T>() => { }; |
13 changes: 13 additions & 0 deletions
13
tests/cases/compiler/unusedTypeParametersNotCheckedByNoUnusedLocals.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,13 @@ | ||
//@noUnusedLocals:true | ||
|
||
function f<T>() { } | ||
|
||
type T<T> = { }; | ||
|
||
interface I<T> { }; | ||
|
||
class C<T> { | ||
public m<V>() { } | ||
}; | ||
|
||
let l = <T>() => { }; |
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
//@noUnusedLocals:true | ||
//@noUnusedParameters:true | ||
|
||
function f<_T, U>() { } | ||
|
||
type T<_T, U> = { }; | ||
|
||
interface I<_T, U> { }; | ||
|
||
class C<_T, U> { }; | ||
class C<_T, U> { | ||
public m<_V, W>() { } | ||
}; | ||
|
||
let l = <_T, U>() => { }; |
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
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
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
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
Oops, something went wrong.