mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
53 lines
818 B
TypeScript
53 lines
818 B
TypeScript
//// [tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts] ////
|
|
|
|
//// [didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts]
|
|
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
|
|
]);
|
|
|
|
|
|
//// [didYouMeanElaborationsForExpressionsWhichCouldBeCalled.js]
|
|
"use strict";
|
|
class Bar {
|
|
}
|
|
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
|
|
]);
|