TypeScript Version: 2.6.0-dev.201xxxxx
Code
function f(x: any) {
console.log(function*() {
while (true) {}
}()); // prints a generator { next: [Function], ....etc }
return 1; // this line is always reached, but compiler reports it as unreachable.
}
console.log(f()) // prints 1
I often produce unreadable code but this is the first I've heard of the compiler raising a warning about it. 馃槆
heh, whoops - title fixed. Thanks.
Seems fixed in latest.
Most helpful comment
I often produce unreadable code but this is the first I've heard of the compiler raising a warning about it. 馃槆