Show exact error position in arrays & arrow functions (original) (raw)

If it is not assignable error and infered expression type origin comes from inside of ast error boundaries we can show exact position of an error source

interface Foo { a: number; }

function foo1(): () => Foo { return () => ({a: ''}); }

function foo2(): Promise { return Promise.resolve({a: ''}); }

function foo3(): Foo[] { return [{a: ''}]; } var y: Foo[] = [{a: ''}] var z: Foo[] = [].map(() => ({a: ''}))

agdagag

@DanielRosenwasser what do you think?