News for hackers. Stuff that matters.
Re:Love for TypeScript by MaulingMonkey on Saturday July 30, 2016 @05:05AM (#12192240)
You may already be aware of this, but it's semi-fixable in TS1:

    function uhoh (x:string|number) {
        if (typeof x === 'string') {
            return x.length
        } else {
            return 'bar'
        }
    }
    function uhoh (x:string): number;
    function uhoh (x:number): string;
    
    const a = uhoh('foo') //= number
    const b = uhoh(3)     //= string

There are no comments on this comment yet.