From 94e1a59fa0c2cc02bedbe822bc70612a93ccd016 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 16 Nov 2018 15:59:14 -0800 Subject: [PATCH] Accepted baselines. --- .../checkJsxChildrenProperty2.errors.txt | 16 ++++++++-------- tests/baselines/reference/inferTypes1.errors.txt | 4 ++-- .../intersectionWithUnionConstraint.errors.txt | 4 ++-- .../reference/keyofAndIndexedAccess.types | 2 +- .../reference/keyofAndIndexedAccessErrors.types | 2 +- .../reference/mappedTypeErrors.errors.txt | 12 ++++++------ .../reference/mappedTypeErrors2.errors.txt | 4 ++-- ...TypeWithRecursiveSubtypeReduction2.errors.txt | 13 +++---------- 8 files changed, 25 insertions(+), 32 deletions(-) diff --git a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt index 0edadf6dc1b..e2931b3fb5d 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt @@ -3,19 +3,19 @@ tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specif tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. - Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props + Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(number | Element)[]' is not assignable to type 'string | Element'. - Type '(number | Element)[]' is missing the following properties from type 'Element': type, props + Type '(number | Element)[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(string | Element)[]' is not assignable to type 'string | Element'. - Type '(string | Element)[]' is missing the following properties from type 'Element': type, props + Type '(string | Element)[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'Element[]' is not assignable to type 'string | Element'. - Type 'Element[]' is missing the following properties from type 'Element': type, props + Type 'Element[]' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (6 errors) ==== @@ -59,7 +59,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'.
My Div
{(name: string) =>
My name {name}
} ; @@ -70,7 +70,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(number | Element)[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string'.
My Div
{1000000} ; @@ -81,7 +81,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(string | Element)[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string'.
My Div
hi hi hi! ; @@ -92,7 +92,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type 'Element[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type 'Element[]' is not assignable to type 'string'.
My Div
My Div
; \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 4684b8f5e34..cbe3eab039c 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -18,7 +18,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: E tests/cases/conformance/types/conditional/inferTypes1.ts(82,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'symbol'. + Type 'T' is not assignable to type 'string'. ==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ==== @@ -202,7 +202,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: type B = string extends T ? { [P in T]: void; } : T; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'symbol'. +!!! error TS2322: Type 'T' is not assignable to type 'string'. // Repro from #22302 diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt index 9bdfc6f30f9..5ed34cbe626 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt +++ b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(7,9): error TS2322: Type 'T & U' is not assignable to type 'string | number'. Type 'string | undefined' is not assignable to type 'string | number'. Type 'undefined' is not assignable to type 'string | number'. - Type 'T & U' is not assignable to type 'number'. + Type 'T & U' is not assignable to type 'string'. tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(8,9): error TS2322: Type 'T & U' is not assignable to type 'string | null'. Type 'string | undefined' is not assignable to type 'string | null'. Type 'undefined' is not assignable to type 'string | null'. @@ -32,7 +32,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12 !!! error TS2322: Type 'T & U' is not assignable to type 'string | number'. !!! error TS2322: Type 'string | undefined' is not assignable to type 'string | number'. !!! error TS2322: Type 'undefined' is not assignable to type 'string | number'. -!!! error TS2322: Type 'T & U' is not assignable to type 'number'. +!!! error TS2322: Type 'T & U' is not assignable to type 'string'. let y2: string | null = x; // Error ~~ !!! error TS2322: Type 'T & U' is not assignable to type 'string | null'. diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 9a14549db4f..f4c47b26df0 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -58,7 +58,7 @@ type K00 = keyof any; // string >K00 : string | number | symbol type K01 = keyof string; // "toString" | "charAt" | ... ->K01 : number | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "valueOf" +>K01 : number | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "valueOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ... >K02 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision" diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index cbf56e6f671..68dc361c99e 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -23,7 +23,7 @@ type T00 = keyof K0; // Error >T00 : string | number | symbol type T01 = keyof Object; ->T01 : "toString" | "constructor" | "toLocaleString" | "valueOf" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" +>T01 : "toString" | "valueOf" | "toLocaleString" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" type T02 = keyof keyof Object; >T02 : number | "length" | "toString" | "valueOf" | "charAt" | "charCodeAt" | "concat" | "indexOf" | "lastIndexOf" | "localeCompare" | "match" | "replace" | "search" | "slice" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 0ae4ebc4681..19be0493cc9 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(19,20): error TS2313: Type parameter 'P' has a circular constraint. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(21,20): error TS2322: Type 'Date' is not assignable to type 'string | number | symbol'. - Type 'Date' is not assignable to type 'symbol'. + Type 'Date' is not assignable to type 'number'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(22,19): error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'. - Type 'Date' is not assignable to type 'symbol'. + Type 'Date' is not assignable to type 'number'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'. @@ -37,7 +37,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'symbol'. + Type 'T' is not assignable to type 'string'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(148,17): error TS2339: Property 'foo' does not exist on type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type 'Record'. @@ -69,11 +69,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: type T02 = { [P in Date]: number }; // Error ~~~~ !!! error TS2322: Type 'Date' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'Date' is not assignable to type 'symbol'. +!!! error TS2322: Type 'Date' is not assignable to type 'number'. type T03 = Record; // Error ~~~~ !!! error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'. -!!! error TS2344: Type 'Date' is not assignable to type 'symbol'. +!!! error TS2344: Type 'Date' is not assignable to type 'number'. type T10 = Pick; type T11 = Pick; // Error @@ -249,7 +249,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: pt: {[P in T]?: T[P]}, // note: should be in keyof T ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'symbol'. +!!! error TS2322: Type 'T' is not assignable to type 'string'. ~~~~ !!! error TS2536: Type 'P' cannot be used to index type 'T'. }; diff --git a/tests/baselines/reference/mappedTypeErrors2.errors.txt b/tests/baselines/reference/mappedTypeErrors2.errors.txt index 9178731d189..d48db498154 100644 --- a/tests/baselines/reference/mappedTypeErrors2.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors2.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(9,30): error TS2536: T tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(13,30): error TS2536: Type 'K' cannot be used to index type 'T3'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,38): error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. - Type 'AB[S]' is not assignable to type 'symbol'. + Type 'AB[S]' is not assignable to type 'string'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2536: Type 'S' cannot be used to index type 'AB'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: Type 'L' cannot be used to index type '{ [key in AB[S]]: true; }'. @@ -31,7 +31,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: !!! error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. ~~~~~ !!! error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'AB[S]' is not assignable to type 'symbol'. +!!! error TS2322: Type 'AB[S]' is not assignable to type 'string'. ~~~~~ !!! error TS2536: Type 'S' cannot be used to index type 'AB'. diff --git a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt index 1bd7a693966..a849878087f 100644 --- a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt +++ b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt @@ -5,11 +5,7 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(19,1): error TS2 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2322: Type 'Class' is not assignable to type 'Property'. Types of property 'parent' are incompatible. Type 'Namespace' is not assignable to type 'Module | Class'. - Type 'Namespace' is not assignable to type 'Module'. - Types of property 'members' are incompatible. - Type '(Class | Property)[]' is not assignable to type 'Class[]'. - Type 'Class | Property' is not assignable to type 'Class'. - Type 'Property' is not assignable to type 'Class'. + Property 'parent' is missing in type 'Namespace' but required in type 'Class'. ==== tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts (2 errors) ==== @@ -43,9 +39,6 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2 !!! error TS2322: Type 'Class' is not assignable to type 'Property'. !!! error TS2322: Types of property 'parent' are incompatible. !!! error TS2322: Type 'Namespace' is not assignable to type 'Module | Class'. -!!! error TS2322: Type 'Namespace' is not assignable to type 'Module'. -!!! error TS2322: Types of property 'members' are incompatible. -!!! error TS2322: Type '(Class | Property)[]' is not assignable to type 'Class[]'. -!!! error TS2322: Type 'Class | Property' is not assignable to type 'Class'. -!!! error TS2322: Type 'Property' is not assignable to type 'Class'. +!!! error TS2322: Property 'parent' is missing in type 'Namespace' but required in type 'Class'. +!!! related TS2728 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts:10:12: 'parent' is declared here. \ No newline at end of file