diff --git a/tests/baselines/reference/contextuallyTypedObjectLiteralReturnType.errors.txt b/tests/baselines/reference/contextuallyTypedObjectLiteralReturnType.errors.txt deleted file mode 100644 index b010de0f761..00000000000 --- a/tests/baselines/reference/contextuallyTypedObjectLiteralReturnType.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralReturnType.ts(6,24): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralReturnType.ts(7,38): error TS2339: Property 'length' does not exist on type 'number'. - - -==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralReturnType.ts (2 errors) ==== - function id(x: T): T { return x }; - // Correct: type of fnWrapper is (y: number) => { y: number } - var fn = function(y: number) { return { y } }; - var fnWrapper = id(fn); - // Incorrect: type of inlineWrapper is (z: number) => any - var inlineWrapper = id(function(z: number) { return { z } }); - ~~~~~~~~ -!!! error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. - let error1: number = fnWrapper(12).y.length; // should error - ~~~~~~ -!!! error TS2339: Property 'length' does not exist on type 'number'. - let error2: number = inlineWrapper(12).z.length; // should error - \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedObjectLiteralReturnType.js b/tests/baselines/reference/contextuallyTypedObjectLiteralReturnType.js deleted file mode 100644 index b687eaab5f5..00000000000 --- a/tests/baselines/reference/contextuallyTypedObjectLiteralReturnType.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [contextuallyTypedObjectLiteralReturnType.ts] -function id(x: T): T { return x }; -// Correct: type of fnWrapper is (y: number) => { y: number } -var fn = function(y: number) { return { y } }; -var fnWrapper = id(fn); -// Incorrect: type of inlineWrapper is (z: number) => any -var inlineWrapper = id(function(z: number) { return { z } }); -let error1: number = fnWrapper(12).y.length; // should error -let error2: number = inlineWrapper(12).z.length; // should error - - -//// [contextuallyTypedObjectLiteralReturnType.js] -function id(x) { return x; } -; -// Correct: type of fnWrapper is (y: number) => { y: number } -var fn = function (y) { return { y: y }; }; -var fnWrapper = id(fn); -// Incorrect: type of inlineWrapper is (z: number) => any -var inlineWrapper = id(function (z) { return { z: z }; }); -var error1 = fnWrapper(12).y.length; // should error -var error2 = inlineWrapper(12).z.length; // should error diff --git a/tests/cases/compiler/inferFromConstraints.ts b/tests/cases/compiler/inferFromConstraints.ts deleted file mode 100644 index d41d5ce7c46..00000000000 --- a/tests/cases/compiler/inferFromConstraints.ts +++ /dev/null @@ -1,9 +0,0 @@ -interface Ctor { - new(): T; -} -// declare function create1(ctor: Ctor): T; -declare function create2>(ctor: C): T; - -class A { a: number } -// let a1 = create1(A).a; // a: A --> OK -let a2 = create2(A).a; // a: {} --> Should be A diff --git a/tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralReturnType.ts b/tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralReturnType.ts deleted file mode 100644 index 5e4500d1cb9..00000000000 --- a/tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralReturnType.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @noImplicitAny: true -function id(x: T): T { return x }; -// Correct: type of fnWrapper is (y: number) => { y: number } -var fn = function(y: number) { return { y } }; -var fnWrapper = id(fn); -// Incorrect: type of inlineWrapper is (z: number) => any -var inlineWrapper = id(function(z: number) { return { z } }); -let error1: number = fnWrapper(12).y.length; // should error -let error2: number = inlineWrapper(12).z.length; // should error