Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS6133: 'T' is declared but its value is never read #21931

Closed
yortus opened this issue Feb 14, 2018 · 3 comments
Closed

TS6133: 'T' is declared but its value is never read #21931

yortus opened this issue Feb 14, 2018 · 3 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@yortus
Copy link
Contributor

yortus commented Feb 14, 2018

TypeScript Version: 2.8.0-dev.20180213

Search Terms:

  • TS6133

Code

interface A<T> { T: T } // ERROR
//         ^^^ TS6133: 'T' is declared but its value is never read.

type B<T> = { T: T };   // OK

Expected behavior:
No errors.

Actual behavior:
TSC thinks the generic type T is unused in interface A, but it is used. Meanwhile the equivalent type B gets it right.

@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Feb 14, 2018
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 2.8 milestone Feb 14, 2018
@ghost
Copy link

ghost commented Feb 14, 2018

It looks like this actually does work in [email protected] -- was broken in [email protected] though.

@ghost ghost closed this as completed Feb 14, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Feb 14, 2018
@yortus
Copy link
Contributor Author

yortus commented Feb 15, 2018

@Andy-MS I'm definitely repro'ing this in typescript@next. Can you take another look please?

ts6133

@ghost
Copy link

ghost commented Feb 15, 2018

Oh, sorry, this was changed to --noUnusedParameters instead of --noUnusedLocals (#21167) so the error went away for me.

@ghost ghost reopened this Feb 15, 2018
@ghost ghost removed the Fixed A PR has been merged for this issue label Feb 15, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Feb 15, 2018
@ghost ghost closed this as completed in #21966 Feb 15, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants