Open sv158 opened 4 years ago
Looks legit, want to submit a PR making that declare var people
?
@orta while using declare var
, the js code generated is different.
There is also a similar problem at https://github.com/microsoft/TypeScript-Handbook/blame/master/pages/Type%20Compatibility.md#L221
interface Empty<T> {
}
let x: Empty<number>;
let y: Empty<string>;
x = y; // variable 'y' is used before being assigned.
and https://github.com/microsoft/TypeScript-Handbook/blame/master/pages/Type%20Compatibility.md#L200
class Animal {
feet: number;
constructor(name: string, numFeet: number) { }
}
class Size {
feet: number;
constructor(numFeet: number) { }
}
let a: Animal;
let s: Size;
a = s; // variable 's' is used before being assigned.
s = a;
https://github.com/microsoft/TypeScript-Handbook/blame/master/pages/Advanced%20Types.md#L500
Variable 'people' is used before being assigned.