From 56e0c6b16ed4c24661deadda890220c012e7003f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 27 Sep 2019 15:20:03 -0700 Subject: [PATCH] Accept new baselines --- .../reference/assertionTypePredicates1.errors.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/baselines/reference/assertionTypePredicates1.errors.txt b/tests/baselines/reference/assertionTypePredicates1.errors.txt index 68253ff06b6..2fe95b99548 100644 --- a/tests/baselines/reference/assertionTypePredicates1.errors.txt +++ b/tests/baselines/reference/assertionTypePredicates1.errors.txt @@ -5,9 +5,9 @@ tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(121,15): error T tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(122,15): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(123,15): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(124,15): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(129,5): error TS2775: Control flow effects of calls to assertion and never-returning functions are reflected only when every variable or property referenced in the function expression is declared with an explicit type annotation. -tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(131,5): error TS2776: Control flow effects of calls to assertion and never-returning functions are reflected only when the function expression is an identifier or qualified-name. -tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(133,5): error TS2775: Control flow effects of calls to assertion and never-returning functions are reflected only when every variable or property referenced in the function expression is declared with an explicit type annotation. +tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(129,5): error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation. +tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(131,5): error TS2776: Assertions require the call target to be an identifier or qualified name. +tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(133,5): error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation. ==== tests/cases/conformance/controlFlow/assertionTypePredicates1.ts (10 errors) ==== @@ -155,15 +155,17 @@ tests/cases/conformance/controlFlow/assertionTypePredicates1.ts(133,5): error TS const assert = (value: unknown): asserts value => {} assert(typeof x === "string"); // Error ~~~~~~ -!!! error TS2775: Control flow effects of calls to assertion and never-returning functions are reflected only when every variable or property referenced in the function expression is declared with an explicit type annotation. +!!! error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation. +!!! related TS2728 tests/cases/conformance/controlFlow/assertionTypePredicates1.ts:128:11: 'assert' is declared here. const a = [assert]; a[0](typeof x === "string"); // Error ~~~~ -!!! error TS2776: Control flow effects of calls to assertion and never-returning functions are reflected only when the function expression is an identifier or qualified-name. +!!! error TS2776: Assertions require the call target to be an identifier or qualified name. const t1 = new Test(); t1.assert(typeof x === "string"); // Error ~~~~~~~~~ -!!! error TS2775: Control flow effects of calls to assertion and never-returning functions are reflected only when every variable or property referenced in the function expression is declared with an explicit type annotation. +!!! error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation. +!!! related TS2728 tests/cases/conformance/controlFlow/assertionTypePredicates1.ts:132:11: 't1' is declared here. const t2: Test = new Test(); t2.assert(typeof x === "string"); }