Skip to content

Later export causes 'T' is referenced directly or indirectly in its own type annotationย #27110

Open
@ghost

Description

TypeScript Version: 3.1.0-dev.20180914

Code

/** @typedef {{}} T */

/** @type {T} */
const T = JSON.parse("");

export class C extends T {}

Expected behavior:

Same error as if the class isn't exported: Type '{}' is not a constructor function type. at the extends clause.

Actual behavior:

src/a.js:4:7 - error TS2502: 'T' is referenced directly or indirectly in its own type annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallycheckJsRelates to checking JavaScript using TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions