Skip to content

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

@yortus

Description

@yortus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions