``` ts 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 ``` ts declare function f(): nothing; ``` this is a regression introduced by https://github.com/Microsoft/TypeScript/pull/8340