From d5b4ad8c475f055c3ecbd78fa1249bac261be00f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 9 Oct 2020 16:43:59 -0700 Subject: [PATCH] Accepted baselines. --- ...rNoASIOnCallAfterFunctionExpression1.errors.txt | 6 +++++- ...mentAccessOnVoidNoImplicitAnyFalse01.errors.txt | 14 +++++++++++++- .../thisTypeInFunctionsNegative.errors.txt | 11 ++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt index 16d2122ff74..91395118208 100644 --- a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt +++ b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt @@ -1,10 +1,14 @@ +tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(1,9): error TS2797: Object is possibly 'void'. tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(2,2): error TS2554: Expected 0 arguments, but got 1. tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(2,15): error TS2339: Property 'foo' does not exist on type 'void'. -==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (3 errors) ==== var x = function () { } + ~~~~~~~~~~~~~~~ (window).foo; + ~~~~~~~~~~~~~ +!!! error TS2797: Object is possibly 'void'. ~~~~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. ~~~ diff --git a/tests/baselines/reference/propertyElementAccessOnVoidNoImplicitAnyFalse01.errors.txt b/tests/baselines/reference/propertyElementAccessOnVoidNoImplicitAnyFalse01.errors.txt index a5f76ef0ce5..671aaff658c 100644 --- a/tests/baselines/reference/propertyElementAccessOnVoidNoImplicitAnyFalse01.errors.txt +++ b/tests/baselines/reference/propertyElementAccessOnVoidNoImplicitAnyFalse01.errors.txt @@ -1,21 +1,33 @@ +tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts(6,5): error TS2797: Object is possibly 'void'. +tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts(7,5): error TS2797: Object is possibly 'void'. tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts(7,12): error TS2339: Property 'world' does not exist on type 'void'. +tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts(10,17): error TS2797: Object is possibly 'void'. +tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts(11,17): error TS2797: Object is possibly 'void'. tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts(11,24): error TS2339: Property 'world' does not exist on type 'void'. -==== tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts (2 errors) ==== +==== tests/cases/compiler/propertyElementAccessOnVoidNoImplicitAnyFalse01.ts (6 errors) ==== let result = [1, 2, 3, 4].forEach(x => { console.log(x); }); if (Math.random()) { result["hello"] = "foo"; + ~~~~~~ +!!! error TS2797: Object is possibly 'void'. result.world = "foo"; + ~~~~~~ +!!! error TS2797: Object is possibly 'void'. ~~~~~ !!! error TS2339: Property 'world' does not exist on type 'void'. } else { console.log(result["hello"]); + ~~~~~~ +!!! error TS2797: Object is possibly 'void'. console.log(result.world); + ~~~~~~ +!!! error TS2797: Object is possibly 'void'. ~~~~~ !!! error TS2339: Property 'world' does not exist on type 'void'. } \ No newline at end of file diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 6c726e5e6f9..e734f9a8d85 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(16,10): error TS2797: Object is possibly 'void'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(16,15): error TS2339: Property 'n' does not exist on type 'void'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(39,16): error TS2797: Object is possibly 'void'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(39,21): error TS2339: Property 'a' does not exist on type 'void'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(49,1): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type '{ a: number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(51,1): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(56,21): error TS2339: Property 'notFound' does not exist on type '{ y: number; }'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(59,16): error TS2797: Object is possibly 'void'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(59,21): error TS2339: Property 'notSpecified' does not exist on type 'void'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(61,79): error TS2322: Type '{ y: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. @@ -95,7 +98,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(177,19): e tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot have a 'this' parameter. -==== tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts (65 errors) ==== +==== tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts (68 errors) ==== class C { n: number; explicitThis(this: this, m: number): number { @@ -112,6 +115,8 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e } explicitVoid(this: void, m: number): number { return this.n + m; // 'n' doesn't exist on type 'void'. + ~~~~ +!!! error TS2797: Object is possibly 'void'. ~ !!! error TS2339: Property 'n' does not exist on type 'void'. } @@ -137,6 +142,8 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e a: 12, explicitVoid1() { return this.a; // error, no 'a' in 'void' + ~~~~ +!!! error TS2797: Object is possibly 'void'. ~ !!! error TS2339: Property 'a' does not exist on type 'void'. }, @@ -165,6 +172,8 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e } function voidThisSpecified(this: void, x: number): number { return x + this.notSpecified; + ~~~~ +!!! error TS2797: Object is possibly 'void'. ~~~~~~~~~~~~ !!! error TS2339: Property 'notSpecified' does not exist on type 'void'. }