Skip to content

type nothing emitted in generated .d.ts files #8345

Closed
@mhegazy

Description

@mhegazy
function f() {
    var x: string | undefined = undefined;
    y = 0;
    if (x) {
       var y: typeof x;
    }
    return y; // y has type nothing
}

generates invalid .d.ts file

declare function f(): nothing;

this is a regression introduced by #8340

Metadata

Metadata

Assignees

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