We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Function expression type inference in constructor
1 parent 9f7ff5d commit aa32a5cCopy full SHA for aa32a5c
test/unit/assignments/functionExpressionTypeInference.spec.ts
@@ -335,9 +335,9 @@ test.each([
335
const code = `
336
class C {
337
result: string;
338
- constructor(fn: (s: string) => string) { this.result = fn("foo"); }
+ constructor(fn: ${funcType}) { this.result = fn("foo"); }
339
}
340
- const c = new C(s => s);
+ const c = new C(${funcExp});
341
return c.result;
342
`;
343
expect(util.transpileAndExecute(code)).toBe("foo");
0 commit comments