TypeScript Version: 3.1.0-dev.20180912
Code
function f<T extends string | undefined>(x: T): number {
return x && 42;
}
f(undefined).toFixed();
Expected behavior:
Error -- the output may be "" or undefined.
Actual behavior:
No error. (Error at runtime.)