TypeScript/tests/cases/compiler/errorOnUnionVsObjectShouldDeeplyDisambiguate2.ts
Wesley Wigham 291ab63a9b
Reuse "getBestMatchingType" logic during elaboration to allow for more specific elaborations (#35278)
* Filter target union during elaboration to allow for more specific elaborations

* Reuse best match logic instead

* Update user baselines (#48)

Co-authored-by: TypeScript Bot <ts_bot@rcavanaugh.com>
2020-01-02 13:14:08 -08:00

29 lines
648 B
TypeScript

interface Stuff {
a?: () => Promise<number[]>;
b: () => Promise<string>;
c: () => Promise<string>;
d: () => Promise<string>;
e: () => Promise<string>;
f: () => Promise<string>;
g: () => Promise<string>;
h: () => Promise<string>;
i: () => Promise<string>;
j: () => Promise<string>;
k: () => Promise<number>;
}
function foo(): Stuff | Date {
return {
a() { return [123] },
b: () => "hello",
c: () => "hello",
d: () => "hello",
e: () => "hello",
f: () => "hello",
g: () => "hello",
h: () => "hello",
i: () => "hello",
j: () => "hello",
k: () => 123
}
}