TypeScript/tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts
Wesley Wigham 1c1379252e
Prefer elaborating on expressions which could be called to produce a correct type by suggesting such (#27016)
* Prefer elaborating on expressions which could be called to produce a correct type by suggesting such

* Pass relation through elaboration machinery
2018-09-11 14:11:31 -07:00

28 lines
384 B
TypeScript

class Bar {
x!: string;
}
declare function getNum(): number;
declare function foo(arg: { x: Bar, y: Date }, item: number, items?: [number, number, number]): void;
foo({
x: Bar,
y: Date
}, getNum());
foo({
x: new Bar(),
y: new Date()
}, getNum);
foo({
x: new Bar(),
y: new Date()
}, getNum(), [
1,
2,
getNum
]);