diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt index 236dfee0979..c651110071d 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt +++ b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt @@ -12,11 +12,10 @@ tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTypin tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(27,44): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(28,46): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(28,114): error TS2347: Untyped function calls may not accept type arguments. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(30,45): error TS2349: Cannot invoke an expression whose type lacks a call signature. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(31,46): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(31,33): error TS2347: Untyped function calls may not accept type arguments. -==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts (16 errors) ==== +==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts (15 errors) ==== // These tests ensure that in cases where it may *appear* that a value has a type, // they actually are properly being contextually typed. The way we test this is // that we invoke contextually typed arguments with type arguments. @@ -74,11 +73,9 @@ tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTypin ~~~~~~~~~~~~~~~~~~~~ !!! error TS2347: Untyped function calls may not accept type arguments. - var lambda1: (x: number) => number = x => { x(undefined); return x; }; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. - var lambda2: (x: number) => number = (x => { x(undefined); return x; }); - ~~~~~~~~~~~~~~~~~~~~ + var lambda1: FuncType = x => { x(undefined); return x; }; + var lambda2: FuncType = (x => { x(undefined); return x; }); + ~~~~~~~~~~~~~~~~~~~~ !!! error TS2347: Untyped function calls may not accept type arguments. type ObjType = { x: (p: number) => string; y: (p: string) => number }; diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.js b/tests/baselines/reference/parenthesizedContexualTyping2.js index 724cbaba2b6..2ce2e35c906 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.js +++ b/tests/baselines/reference/parenthesizedContexualTyping2.js @@ -28,8 +28,8 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); -var lambda1: (x: number) => number = x => { x(undefined); return x; }; -var lambda2: (x: number) => number = (x => { x(undefined); return x; }); +var lambda1: FuncType = x => { x(undefined); return x; }; +var lambda2: FuncType = (x => { x(undefined); return x; }); type ObjType = { x: (p: number) => string; y: (p: string) => number }; var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; diff --git a/tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts b/tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts index 5d235bff348..87f3dc6a580 100644 --- a/tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts +++ b/tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts @@ -27,8 +27,8 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); -var lambda1: (x: number) => number = x => { x(undefined); return x; }; -var lambda2: (x: number) => number = (x => { x(undefined); return x; }); +var lambda1: FuncType = x => { x(undefined); return x; }; +var lambda2: FuncType = (x => { x(undefined); return x; }); type ObjType = { x: (p: number) => string; y: (p: string) => number }; var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) };