diff --git a/internal/printer/printer.go b/internal/printer/printer.go index 8d68f20015..2744cfa39b 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -1964,7 +1964,7 @@ func (p *Printer) emitNamedTupleMember(node *ast.NamedTupleMember) { } func (p *Printer) emitUnionTypeConstituent(node *ast.TypeNode) { - p.emitTypeNode(node, ast.TypePrecedenceIntersection) + p.emitTypeNode(node, ast.TypePrecedenceTypeOperator) } func (p *Printer) emitUnionType(node *ast.UnionTypeNode) { diff --git a/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types b/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types index 66c1f3be4a..39048bb643 100644 --- a/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types +++ b/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types @@ -19,7 +19,7 @@ interface MachineConfig { }; on?: { ->on : { [K in TEvent["type"]]?: Action | undefined; } & { "*"?: Action | undefined; } | undefined +>on : ({ [K in TEvent["type"]]?: Action | undefined; } & { "*"?: Action | undefined; }) | undefined [K in TEvent["type"]]?: Action; >type : K @@ -121,7 +121,7 @@ interface MachineConfig2 { }; on?: { ->on : { [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action | undefined; } & { "*"?: Action | undefined; } | undefined +>on : ({ [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action | undefined; } & { "*"?: Action | undefined; }) | undefined [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action; >type : K diff --git a/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types.diff b/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types.diff index aa7b25e05c..f07aed5900 100644 --- a/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types.diff +++ b/testdata/baselines/reference/submodule/compiler/contextualTypeFunctionObjectPropertyIntersection.types.diff @@ -5,7 +5,7 @@ }; on?: { ->on : ({ [K in TEvent["type"]]?: Action | undefined; } & { "*"?: Action; }) | undefined -+>on : { [K in TEvent["type"]]?: Action | undefined; } & { "*"?: Action | undefined; } | undefined ++>on : ({ [K in TEvent["type"]]?: Action | undefined; } & { "*"?: Action | undefined; }) | undefined [K in TEvent["type"]]?: Action; >type : K @@ -14,7 +14,7 @@ }; on?: { ->on : ({ [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action | undefined; } & { "*"?: Action; }) | undefined -+>on : { [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action | undefined; } & { "*"?: Action | undefined; } | undefined ++>on : ({ [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action | undefined; } & { "*"?: Action | undefined; }) | undefined [K in TEvent["type"] as K extends Uppercase ? K : never]?: Action; >type : K diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt index 7842b6a269..faf11254bb 100644 --- a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt @@ -1,7 +1,7 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(13,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema1; }'. -excessPropertyCheckIntersectionWithRecursiveType.ts(26,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. +excessPropertyCheckIntersectionWithRecursiveType.ts(26,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. excessPropertyCheckIntersectionWithRecursiveType.ts(39,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema3; }'. -excessPropertyCheckIntersectionWithRecursiveType.ts(52,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. +excessPropertyCheckIntersectionWithRecursiveType.ts(52,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. excessPropertyCheckIntersectionWithRecursiveType.ts(86,11): error TS2353: Object literal may only specify known properties, and 'children' does not exist in type 'User'. excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Property 'children' does not exist on type 'User'. @@ -37,8 +37,8 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope l2: { type: 'boolean' }, invalid: false, ~~~~~~~ -!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. -!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:19:78: The expected type comes from property 'props' which is declared here on type '{ props: { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; } & Example<{ l2: boolean; }>' +!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. +!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:19:78: The expected type comes from property 'props' which is declared here on type '{ props: { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; } & Example<{ l2: boolean; }>' }, }, }, @@ -69,8 +69,8 @@ excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Prope l2: { type: 'boolean' }, invalid: false, ~~~~~~~ -!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. -!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:45:78: The expected type comes from property 'props' which is declared here on type '{ props: Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; }' +!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. +!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:45:78: The expected type comes from property 'props' which is declared here on type '{ props: Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; }' }, }, }, diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt.diff deleted file mode 100644 index 65a05ea714..0000000000 --- a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.errors.txt.diff +++ /dev/null @@ -1,34 +0,0 @@ ---- old.excessPropertyCheckIntersectionWithRecursiveType.errors.txt -+++ new.excessPropertyCheckIntersectionWithRecursiveType.errors.txt -@@= skipped -0, +0 lines =@@ - excessPropertyCheckIntersectionWithRecursiveType.ts(13,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema1; }'. --excessPropertyCheckIntersectionWithRecursiveType.ts(26,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. -+excessPropertyCheckIntersectionWithRecursiveType.ts(26,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. - excessPropertyCheckIntersectionWithRecursiveType.ts(39,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: Schema3; }'. --excessPropertyCheckIntersectionWithRecursiveType.ts(52,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. -+excessPropertyCheckIntersectionWithRecursiveType.ts(52,9): error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. - excessPropertyCheckIntersectionWithRecursiveType.ts(86,11): error TS2353: Object literal may only specify known properties, and 'children' does not exist in type 'User'. - excessPropertyCheckIntersectionWithRecursiveType.ts(102,35): error TS2339: Property 'children' does not exist on type 'User'. - -@@= skipped -36, +36 lines =@@ - l2: { type: 'boolean' }, - invalid: false, - ~~~~~~~ --!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. --!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:19:78: The expected type comes from property 'props' which is declared here on type '{ props: { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; } & Example<{ l2: boolean; }>' -+!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type '{ l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. -+!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:19:78: The expected type comes from property 'props' which is declared here on type '{ props: { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; } & Example<{ l2: boolean; }>' - }, - }, - }, -@@= skipped -32, +32 lines =@@ - l2: { type: 'boolean' }, - invalid: false, - ~~~~~~~ --!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }'. --!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:45:78: The expected type comes from property 'props' which is declared here on type '{ props: Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; }' -+!!! error TS2353: Object literal may only specify known properties, and 'invalid' does not exist in type 'Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }'. -+!!! related TS6500 excessPropertyCheckIntersectionWithRecursiveType.ts:45:78: The expected type comes from property 'props' which is declared here on type '{ props: Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; }' - }, - }, - }, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types index aa6b423891..4430e1b7f6 100644 --- a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types +++ b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types @@ -54,7 +54,7 @@ type Schema2 = (T extends boolean ? { type: 'boolean'; } & Example : { pro >props : { [P in keyof T]: Schema2; } export const schemaObj2: Schema2 = { ->schemaObj2 : { props: { l1: { props: { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; } & Example<{ l2: boolean; }>; }; } & Example +>schemaObj2 : { props: { l1: { props: { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; } & Example<{ l2: boolean; }>; }; } & Example >{ props: { l1: { props: { l2: { type: 'boolean' }, invalid: false, }, }, },} : { props: { l1: { props: { l2: { type: "boolean"; }; invalid: boolean; }; }; }; } props: { @@ -126,7 +126,7 @@ type Schema4 = (T extends boolean ? { type: 'boolean'; } & Example : { pro >props : Example & { [P in keyof T]: Schema4; } export const schemaObj4: Schema4 = { ->schemaObj4 : { props: Example & { l1: { props: Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; }; }; } +>schemaObj4 : { props: Example & { l1: { props: Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; }; }; } >{ props: { l1: { props: { l2: { type: 'boolean' }, invalid: false, }, }, },} : { props: { l1: { props: { l2: { type: "boolean"; }; invalid: boolean; }; }; }; } props: { diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types.diff b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types.diff index 0e61f56a60..631d02a87e 100644 --- a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types.diff +++ b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckIntersectionWithRecursiveType.types.diff @@ -1,24 +1,6 @@ --- old.excessPropertyCheckIntersectionWithRecursiveType.types +++ new.excessPropertyCheckIntersectionWithRecursiveType.types -@@= skipped -53, +53 lines =@@ - >props : { [P in keyof T]: Schema2; } - - export const schemaObj2: Schema2 = { -->schemaObj2 : { props: { l1: { props: { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; } & Example<{ l2: boolean; }>; }; } & Example -+>schemaObj2 : { props: { l1: { props: { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; } & Example<{ l2: boolean; }>; }; } & Example - >{ props: { l1: { props: { l2: { type: 'boolean' }, invalid: false, }, }, },} : { props: { l1: { props: { l2: { type: "boolean"; }; invalid: boolean; }; }; }; } - - props: { -@@= skipped -72, +72 lines =@@ - >props : Example & { [P in keyof T]: Schema4; } - - export const schemaObj4: Schema4 = { -->schemaObj4 : { props: Example & { l1: { props: Example<{ l2: boolean; }> & { l2: ({ type: "boolean"; } & Example) | ({ type: "boolean"; } & Example); }; }; }; } -+>schemaObj4 : { props: Example & { l1: { props: Example<{ l2: boolean; }> & { l2: { type: "boolean"; } & Example | { type: "boolean"; } & Example; }; }; }; } - >{ props: { l1: { props: { l2: { type: 'boolean' }, invalid: false, }, }, },} : { props: { l1: { props: { l2: { type: "boolean"; }; invalid: boolean; }; }; }; } - - props: { -@@= skipped -56, +56 lines =@@ +@@= skipped -181, +181 lines =@@ >1 : T 0: T & { children: BuildTree>[] }; diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt index ac6fa6bafe..66d57c2dae 100644 --- a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt @@ -2,7 +2,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(30,5): error TS2353: Object lite excessPropertyCheckWithMultipleDiscriminants.ts(41,5): error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "left"; p2: boolean; }'. excessPropertyCheckWithMultipleDiscriminants.ts(50,5): error TS2353: Object literal may only specify known properties, and 'p4' does not exist in type '{ p1: "left"; p2: true; p3: number; } | { p1: "left"; p2: boolean; }'. excessPropertyCheckWithMultipleDiscriminants.ts(57,5): error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "right"; p2: false; p4: string; }'. -excessPropertyCheckWithMultipleDiscriminants.ts(83,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | Common & A'. +excessPropertyCheckWithMultipleDiscriminants.ts(83,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. excessPropertyCheckWithMultipleDiscriminants.ts(93,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'A | Common'. excessPropertyCheckWithMultipleDiscriminants.ts(131,5): error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'OneToOneAttribute | StringAttribute'. excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute'. @@ -101,7 +101,7 @@ excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2353: Object lit a: 1, b: 1 // excess property ~ -!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | Common & A'. +!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. } type CommonWithDisjointOverlappingOptionals = Common | A | B; diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt.diff deleted file mode 100644 index bd9af34bf2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithMultipleDiscriminants.errors.txt.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.excessPropertyCheckWithMultipleDiscriminants.errors.txt -+++ new.excessPropertyCheckWithMultipleDiscriminants.errors.txt -@@= skipped -1, +1 lines =@@ - excessPropertyCheckWithMultipleDiscriminants.ts(41,5): error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "left"; p2: boolean; }'. - excessPropertyCheckWithMultipleDiscriminants.ts(50,5): error TS2353: Object literal may only specify known properties, and 'p4' does not exist in type '{ p1: "left"; p2: true; p3: number; } | { p1: "left"; p2: boolean; }'. - excessPropertyCheckWithMultipleDiscriminants.ts(57,5): error TS2353: Object literal may only specify known properties, and 'p3' does not exist in type '{ p1: "right"; p2: false; p4: string; }'. --excessPropertyCheckWithMultipleDiscriminants.ts(83,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. -+excessPropertyCheckWithMultipleDiscriminants.ts(83,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | Common & A'. - excessPropertyCheckWithMultipleDiscriminants.ts(93,5): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'A | Common'. - excessPropertyCheckWithMultipleDiscriminants.ts(131,5): error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'OneToOneAttribute | StringAttribute'. - excessPropertyCheckWithMultipleDiscriminants.ts(137,5): error TS2353: Object literal may only specify known properties, and 'autoIncrement' does not exist in type 'StringAttribute'. -@@= skipped -99, +99 lines =@@ - a: 1, - b: 1 // excess property - ~ --!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | (Common & A)'. -+!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type 'Common | Common & A'. - } - - type CommonWithDisjointOverlappingOptionals = Common | A | B; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types b/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types index d01068391a..4726b282eb 100644 --- a/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types +++ b/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types @@ -148,7 +148,7 @@ function union5(p: T | U) "key" in p; >"key" in p : boolean >"key" : "key" ->p : T & object | U & object +>p : (T & object) | (U & object) } } diff --git a/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types.diff b/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types.diff index 8442052886..59ae60aca2 100644 --- a/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types.diff +++ b/testdata/baselines/reference/submodule/compiler/inDoesNotOperateOnPrimitiveTypes.types.diff @@ -26,12 +26,4 @@ +>union5 : (p: T | U) => void >p : T | U - // For consistency, this should probably not be an error, because useful -@@= skipped -25, +25 lines =@@ - "key" in p; - >"key" in p : boolean - >"key" : "key" -->p : (T & object) | (U & object) -+>p : T & object | U & object - } - } + // For consistency, this should probably not be an error, because useful \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types b/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types index 0ce86439e4..603bbba925 100644 --- a/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types +++ b/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types @@ -12,17 +12,17 @@ class B { b = 0 } >0 : 0 function f10(obj: A & { x: string } | B) { ->f10 : (obj: B | A & { x: string; }) => void ->obj : B | A & { x: string; } +>f10 : (obj: B | (A & { x: string; })) => void +>obj : B | (A & { x: string; }) >x : string if (obj instanceof Object) { >obj instanceof Object : boolean ->obj : B | A & { x: string; } +>obj : B | (A & { x: string; }) >Object : ObjectConstructor obj; // A & { x: string } | B ->obj : B | A & { x: string; } +>obj : B | (A & { x: string; }) } else { obj; // Error diff --git a/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types.diff b/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types.diff index d85a30208f..52af7b116f 100644 --- a/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types.diff +++ b/testdata/baselines/reference/submodule/compiler/inKeywordAndIntersection.types.diff @@ -5,20 +5,6 @@ function f10(obj: A & { x: string } | B) { ->f10 : (obj: (A & { x: string; }) | B) => void -->obj : B | (A & { x: string; }) -+>f10 : (obj: B | A & { x: string; }) => void -+>obj : B | A & { x: string; } ++>f10 : (obj: B | (A & { x: string; })) => void + >obj : B | (A & { x: string; }) >x : string - - if (obj instanceof Object) { - >obj instanceof Object : boolean -->obj : B | (A & { x: string; }) -+>obj : B | A & { x: string; } - >Object : ObjectConstructor - - obj; // A & { x: string } | B -->obj : B | (A & { x: string; }) -+>obj : B | A & { x: string; } - } - else { - obj; // Error \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types b/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types index faee59fc37..769115a81f 100644 --- a/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types +++ b/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types @@ -442,15 +442,15 @@ function negativeIntersectionTest() { >window : Window & typeof globalThis window.ontouchstart ->window.ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined +>window.ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined >window : Window & typeof globalThis ->ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined +>ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined } else { window.ontouchstart ->window.ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined +>window.ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined >window : Window & typeof globalThis ->ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined +>ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined } } @@ -1030,7 +1030,7 @@ function foo(value: A) { >value : A >"object" : "object" >value !== null : boolean ->value : A & null | A & object +>value : (A & null) | (A & object) >"prop" in value : boolean >"prop" : "prop" >value : A & object diff --git a/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types.diff b/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types.diff index 66099627f9..7c1b5f737d 100644 --- a/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types.diff +++ b/testdata/baselines/reference/submodule/compiler/inKeywordTypeguard(strict=true).types.diff @@ -1,26 +1,6 @@ --- old.inKeywordTypeguard(strict=true).types +++ new.inKeywordTypeguard(strict=true).types -@@= skipped -441, +441 lines =@@ - >window : Window & typeof globalThis - - window.ontouchstart -->window.ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined -+>window.ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined - >window : Window & typeof globalThis -->ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined -+>ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined - - } else { - window.ontouchstart -->window.ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined -+>window.ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined - >window : Window & typeof globalThis -->ontouchstart : (((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any)) | null | undefined -+>ontouchstart : ((this: GlobalEventHandlers, ev: TouchEvent) => any) & ((this: Window, ev: TouchEvent) => any) | null | undefined - } - } - -@@= skipped -505, +505 lines =@@ +@@= skipped -946, +946 lines =@@ } function f13(x: { a?: string }) { @@ -47,16 +27,7 @@ } } -@@= skipped -83, +83 lines =@@ - >value : A - >"object" : "object" - >value !== null : boolean -->value : (A & null) | (A & object) -+>value : A & null | A & object - >"prop" in value : boolean - >"prop" : "prop" - >value : A & object -@@= skipped -46, +46 lines =@@ +@@= skipped -129, +129 lines =@@ // Repro from #51549 const f =

(a: P & {}) => { diff --git a/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types b/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types index 649be356ed..324860fe97 100644 --- a/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types +++ b/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types @@ -57,7 +57,7 @@ function flatMapChildren(node: Node, cb: (child: Node) => readonly T[] | T | >...toArray(value) : T >toArray(value) : readonly T[] >toArray : { (value: T_1 | T_1[]): T_1[]; (value: T_1 | readonly T_1[]): readonly T_1[]; } ->value : readonly T[] | T & ({} | null) +>value : readonly T[] | (T & ({} | null)) } }); return result; @@ -100,7 +100,7 @@ function flatMapChildren2(node: Node, cb: (child: Node) => readonly T[] | T | >...toArray(value) : T >toArray(value) : readonly T[] >toArray : { (value: T_1 | T_1[]): T_1[]; (value: T_1 | readonly T_1[]): readonly T_1[]; } ->value : readonly T[] | T & ({} | undefined) +>value : readonly T[] | (T & ({} | undefined)) } }); return result; diff --git a/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types.diff b/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types.diff index 65e0a63d5c..f7aff62a27 100644 --- a/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types.diff +++ b/testdata/baselines/reference/submodule/compiler/inferenceDoesNotAddUndefinedOrNull.types.diff @@ -51,16 +51,7 @@ >child : Node if (value !== undefined) { -@@= skipped -25, +25 lines =@@ - >...toArray(value) : T - >toArray(value) : readonly T[] - >toArray : { (value: T_1 | T_1[]): T_1[]; (value: T_1 | readonly T_1[]): readonly T_1[]; } -->value : readonly T[] | (T & ({} | null)) -+>value : readonly T[] | T & ({} | null) - } - }); - return result; -@@= skipped -8, +8 lines =@@ +@@= skipped -33, +33 lines =@@ } function flatMapChildren2(node: Node, cb: (child: Node) => readonly T[] | T | null): readonly T[] { @@ -91,13 +82,4 @@ +>cb : (child: Node) => T | readonly T[] | null >child : Node - if (value !== null) { -@@= skipped -24, +24 lines =@@ - >...toArray(value) : T - >toArray(value) : readonly T[] - >toArray : { (value: T_1 | T_1[]): T_1[]; (value: T_1 | readonly T_1[]): readonly T_1[]; } -->value : readonly T[] | (T & ({} | undefined)) -+>value : readonly T[] | T & ({} | undefined) - } - }); - return result; \ No newline at end of file + if (value !== null) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types b/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types index 21aa246f2b..f668a1ee84 100644 --- a/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types +++ b/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types @@ -138,14 +138,14 @@ equal(v as string, v as string & { tag: 'foo' } | undefined); >equal : (a: T, b: T) => void >v as string : string >v : never ->v as string & { tag: 'foo' } | undefined : string & { tag: "foo"; } | undefined +>v as string & { tag: 'foo' } | undefined : (string & { tag: "foo"; }) | undefined >v : never >tag : "foo" equal(v as string & { tag: 'foo' } | undefined, v as string); >equal(v as string & { tag: 'foo' } | undefined, v as string) : void >equal : (a: T, b: T) => void ->v as string & { tag: 'foo' } | undefined : string & { tag: "foo"; } | undefined +>v as string & { tag: 'foo' } | undefined : (string & { tag: "foo"; }) | undefined >v : never >tag : "foo" >v as string : string diff --git a/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types.diff b/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types.diff deleted file mode 100644 index 15829f9ca2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/inferenceOfNullableObjectTypesWithCommonBase.types.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.inferenceOfNullableObjectTypesWithCommonBase.types -+++ new.inferenceOfNullableObjectTypesWithCommonBase.types -@@= skipped -137, +137 lines =@@ - >equal : (a: T, b: T) => void - >v as string : string - >v : never -->v as string & { tag: 'foo' } | undefined : (string & { tag: "foo"; }) | undefined -+>v as string & { tag: 'foo' } | undefined : string & { tag: "foo"; } | undefined - >v : never - >tag : "foo" - - equal(v as string & { tag: 'foo' } | undefined, v as string); - >equal(v as string & { tag: 'foo' } | undefined, v as string) : void - >equal : (a: T, b: T) => void -->v as string & { tag: 'foo' } | undefined : (string & { tag: "foo"; }) | undefined -+>v as string & { tag: 'foo' } | undefined : string & { tag: "foo"; } | undefined - >v : never - >tag : "foo" - >v as string : string \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types b/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types index 7271312dcd..acb96de676 100644 --- a/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types +++ b/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types @@ -565,8 +565,8 @@ function multipleGenericFuse(xy: X | case 'number': return [xy] >'number' : "number" ->[xy] : [X & number | Y & number] ->xy : X & number | Y & number +>[xy] : [(X & number) | (Y & number)] +>xy : (X & number) | (Y & number) } } @@ -1105,8 +1105,8 @@ function multipleGenericFuseWithBoth case `number`: return [xy] >`number` : "number" ->[xy] : [X & number | Y & number] ->xy : X & number | Y & number +>[xy] : [(X & number) | (Y & number)] +>xy : (X & number) | (Y & number) } } diff --git a/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types.diff b/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types.diff index 9cb6ed0abd..ddde7ec8e2 100644 --- a/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types.diff +++ b/testdata/baselines/reference/submodule/compiler/narrowingByTypeofInSwitch.types.diff @@ -51,18 +51,7 @@ >xy : X | Y switch (typeof xy) { -@@= skipped -21, +21 lines =@@ - - case 'number': return [xy] - >'number' : "number" -->[xy] : [(X & number) | (Y & number)] -->xy : (X & number) | (Y & number) -+>[xy] : [X & number | Y & number] -+>xy : X & number | Y & number - } - } - -@@= skipped -306, +306 lines =@@ +@@= skipped -327, +327 lines =@@ } function narrowingNarrows2(x: true | 3 | 'hello' | undefined) { @@ -79,14 +68,4 @@ +>multipleGenericFuseWithBoth : (xy: X | Y) => [X | Y] | [X, number] | [Y, string] >xy : X | Y - switch (typeof xy) { -@@= skipped -21, +21 lines =@@ - - case `number`: return [xy] - >`number` : "number" -->[xy] : [(X & number) | (Y & number)] -->xy : (X & number) | (Y & number) -+>[xy] : [X & number | Y & number] -+>xy : X & number | Y & number - } - } + switch (typeof xy) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types b/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types index b65e38c616..55a640d4e6 100644 --- a/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types +++ b/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types @@ -8,13 +8,13 @@ type Meta = { foo: string } interface F { (): string } function f1(a: (F & Meta) | string) { ->f1 : (a: string | F & Meta) => void ->a : string | F & Meta +>f1 : (a: string | (F & Meta)) => void +>a : string | (F & Meta) if (typeof a === "function") { >typeof a === "function" : boolean >typeof a : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" ->a : string | F & Meta +>a : string | (F & Meta) >"function" : "function" a; @@ -27,13 +27,13 @@ function f1(a: (F & Meta) | string) { } function f2(x: (T & F) | T & string) { ->f2 : (x: T & string | T & F) => void ->x : T & string | T & F +>f2 : (x: (T & string) | (T & F)) => void +>x : (T & string) | (T & F) if (typeof x === "function") { >typeof x === "function" : boolean >typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" ->x : T & string | T & F +>x : (T & string) | (T & F) >"function" : "function" x; diff --git a/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types.diff b/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types.diff index a9e8bb4281..aae1239b70 100644 --- a/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types.diff +++ b/testdata/baselines/reference/submodule/compiler/narrowingTypeofFunction.types.diff @@ -5,32 +5,16 @@ function f1(a: (F & Meta) | string) { ->f1 : (a: (F & Meta) | string) => void -->a : string | (F & Meta) -+>f1 : (a: string | F & Meta) => void -+>a : string | F & Meta ++>f1 : (a: string | (F & Meta)) => void + >a : string | (F & Meta) if (typeof a === "function") { - >typeof a === "function" : boolean - >typeof a : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" -->a : string | (F & Meta) -+>a : string | F & Meta - >"function" : "function" - - a; @@= skipped -19, +19 lines =@@ } function f2(x: (T & F) | T & string) { ->f2 : (x: (T & F) | (T & string)) => void -->x : (T & string) | (T & F) -+>f2 : (x: T & string | T & F) => void -+>x : T & string | T & F - - if (typeof x === "function") { - >typeof x === "function" : boolean - >typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" -->x : (T & string) | (T & F) -+>x : T & string | T & F - >"function" : "function" ++>f2 : (x: (T & string) | (T & F)) => void + >x : (T & string) | (T & F) - x; \ No newline at end of file + if (typeof x === "function") { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types b/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types index 1e74b940bd..da60ca8087 100644 --- a/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types +++ b/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types @@ -33,7 +33,7 @@ function fx2(x: T | undefined) { >x : T | undefined x; // T & Falsy | undefined ->x : T & null | T & "" | T & 0 | T & 0n | T & false | undefined +>x : (T & null) | (T & "") | (T & 0) | (T & 0n) | (T & false) | undefined } } @@ -47,7 +47,7 @@ function fx3(x: T) { >x : string | number x; // T & "" | T & 0 ->x : T & "" | T & 0 +>x : (T & "") | (T & 0) } } diff --git a/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types.diff b/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types.diff index 8b912309bf..65d9dd61ee 100644 --- a/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types.diff +++ b/testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types.diff @@ -5,20 +5,11 @@ x; // T & Falsy | undefined ->x : (T & null) | (T & "") | (T & 0) | (T & false) | (T & 0n) | undefined -+>x : T & null | T & "" | T & 0 | T & 0n | T & false | undefined ++>x : (T & null) | (T & "") | (T & 0) | (T & 0n) | (T & false) | undefined } } -@@= skipped -14, +14 lines =@@ - >x : string | number - - x; // T & "" | T & 0 -->x : (T & "") | (T & 0) -+>x : T & "" | T & 0 - } - } - -@@= skipped -198, +198 lines =@@ +@@= skipped -212, +212 lines =@@ } }, (value?: string) => { diff --git a/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types b/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types index a145c46afd..29ba3f1471 100644 --- a/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types +++ b/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types @@ -134,7 +134,7 @@ function test() { // Excess property checks only on non-generic parts of unions const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; ->obj4 : { name: string; } | T & { prop: boolean; } +>obj4 : { name: string; } | (T & { prop: boolean; }) >prop : boolean >name : string >{ name: "test", prop: true } : { name: string; prop: boolean; } diff --git a/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types.diff b/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types.diff index 16cea5d93a..d6f08e5826 100644 --- a/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types.diff +++ b/testdata/baselines/reference/submodule/compiler/objectLiteralExcessProperties.types.diff @@ -8,13 +8,4 @@ +>{ 0: { }, '1': { } } : { 0: {}; "1": {}; } >0 : {} >{ } : {} - >'1' : {} -@@= skipped -48, +48 lines =@@ - - // Excess property checks only on non-generic parts of unions - const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; -->obj4 : { name: string; } | (T & { prop: boolean; }) -+>obj4 : { name: string; } | T & { prop: boolean; } - >prop : boolean - >name : string - >{ name: "test", prop: true } : { name: string; prop: boolean; } \ No newline at end of file + >'1' : {} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types b/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types index 347130b2bf..6eaddd180b 100644 --- a/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types +++ b/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types @@ -224,7 +224,7 @@ for (const k of keys) { obj[k] = () => "12"; // shouldn't cause a complexity error >obj[k] = () => "12" : () => string ->obj[k] : ((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string) | undefined +>obj[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | undefined >obj : Partial >k : keyof MyAPI >() => "12" : () => string @@ -244,7 +244,7 @@ for (const k of keys) { obj2[k] = () => "12"; // shouldn't cause a complexity error >obj2[k] = () => "12" : () => string ->obj2[k] : ((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string) | null | undefined +>obj2[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | null | undefined >obj2 : PartialNull >k : keyof MyAPI >() => "12" : () => string diff --git a/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types.diff b/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types.diff deleted file mode 100644 index daa369bce4..0000000000 --- a/testdata/baselines/reference/submodule/compiler/partialOfLargeAPIIsAbleToBeWorkedWith.types.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.partialOfLargeAPIIsAbleToBeWorkedWith.types -+++ new.partialOfLargeAPIIsAbleToBeWorkedWith.types -@@= skipped -223, +223 lines =@@ - - obj[k] = () => "12"; // shouldn't cause a complexity error - >obj[k] = () => "12" : () => string -->obj[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | undefined -+>obj[k] : ((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string) | undefined - >obj : Partial - >k : keyof MyAPI - >() => "12" : () => string -@@= skipped -20, +20 lines =@@ - - obj2[k] = () => "12"; // shouldn't cause a complexity error - >obj2[k] = () => "12" : () => string -->obj2[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | null | undefined -+>obj2[k] : ((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string) | null | undefined - >obj2 : PartialNull - >k : keyof MyAPI - >() => "12" : () => string \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types b/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types index 8065b83fb4..c0658f9c03 100644 --- a/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types +++ b/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types @@ -7,15 +7,15 @@ type Kind = "one" | "two" | "three"; >Kind : Kind declare function getInterfaceFromString(options?: { type?: T } & { type?: Kind }): T; ->getInterfaceFromString : (options?: { type?: T | undefined; } & { type?: Kind | undefined; } | undefined) => T ->options : { type?: T | undefined; } & { type?: Kind | undefined; } | undefined +>getInterfaceFromString : (options?: ({ type?: T | undefined; } & { type?: Kind | undefined; }) | undefined) => T +>options : ({ type?: T | undefined; } & { type?: Kind | undefined; }) | undefined >type : T | undefined >type : Kind | undefined const result = getInterfaceFromString({ type: 'two' }); >result : "two" >getInterfaceFromString({ type: 'two' }) : "two" ->getInterfaceFromString : (options?: { type?: T | undefined; } & { type?: Kind | undefined; } | undefined) => T +>getInterfaceFromString : (options?: ({ type?: T | undefined; } & { type?: Kind | undefined; }) | undefined) => T >{ type: 'two' } : { type: "two"; } >type : "two" >'two' : "two" diff --git a/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types.diff b/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types.diff index 3753a245e9..339a560164 100644 --- a/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types.diff +++ b/testdata/baselines/reference/submodule/compiler/primitiveUnionDetection.types.diff @@ -6,8 +6,8 @@ declare function getInterfaceFromString(options?: { type?: T } & { type?: Kind }): T; ->getInterfaceFromString : (options?: { type?: T; } & { type?: Kind; }) => T ->options : ({ type?: T; } & { type?: Kind; }) | undefined -+>getInterfaceFromString : (options?: { type?: T | undefined; } & { type?: Kind | undefined; } | undefined) => T -+>options : { type?: T | undefined; } & { type?: Kind | undefined; } | undefined ++>getInterfaceFromString : (options?: ({ type?: T | undefined; } & { type?: Kind | undefined; }) | undefined) => T ++>options : ({ type?: T | undefined; } & { type?: Kind | undefined; }) | undefined >type : T | undefined >type : Kind | undefined @@ -15,7 +15,7 @@ >result : "two" >getInterfaceFromString({ type: 'two' }) : "two" ->getInterfaceFromString : (options?: { type?: T; } & { type?: Kind; }) => T -+>getInterfaceFromString : (options?: { type?: T | undefined; } & { type?: Kind | undefined; } | undefined) => T ++>getInterfaceFromString : (options?: ({ type?: T | undefined; } & { type?: Kind | undefined; }) | undefined) => T >{ type: 'two' } : { type: "two"; } >type : "two" >'two' : "two" \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types b/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types index 1a14bea821..9bce59101c 100644 --- a/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types +++ b/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types @@ -231,7 +231,7 @@ function isMobile() { typeof window !== 'undefined' && >typeof window !== 'undefined' && window.matchMedia && // no error window.matchMedia('(max-device-width: 680px)') : false | MediaQueryList ->typeof window !== 'undefined' && window.matchMedia : false | ((query: string) => MediaQueryList) & ((query: string) => MediaQueryList) +>typeof window !== 'undefined' && window.matchMedia : false | (((query: string) => MediaQueryList) & ((query: string) => MediaQueryList)) >typeof window !== 'undefined' : boolean >typeof window : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" >window : Window & typeof globalThis diff --git a/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types.diff b/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types.diff index e13946b209..39c4e72feb 100644 --- a/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types.diff +++ b/testdata/baselines/reference/submodule/compiler/uncalledFunctionChecksInConditional2.types.diff @@ -231,13 +231,4 @@ +>clearMarks : (markName?: string | undefined) => void >endTag : any - // perf.clearMeasures(name) -@@= skipped -42, +42 lines =@@ - - typeof window !== 'undefined' && - >typeof window !== 'undefined' && window.matchMedia && // no error window.matchMedia('(max-device-width: 680px)') : false | MediaQueryList -->typeof window !== 'undefined' && window.matchMedia : false | (((query: string) => MediaQueryList) & ((query: string) => MediaQueryList)) -+>typeof window !== 'undefined' && window.matchMedia : false | ((query: string) => MediaQueryList) & ((query: string) => MediaQueryList) - >typeof window !== 'undefined' : boolean - >typeof window : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" - >window : Window & typeof globalThis \ No newline at end of file + // perf.clearMeasures(name) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types b/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types index 72ea79282b..aad8f30f07 100644 --- a/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types +++ b/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types @@ -13,7 +13,7 @@ function isDefined(value: T | undefined | null | void): value is T { >value : void | T | null | undefined >undefined : undefined >value !== null : boolean ->value : T & {} | null +>value : (T & {}) | null } declare const foo: string | undefined; diff --git a/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types.diff b/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types.diff index a55823e6b1..f17c32a1b2 100644 --- a/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types.diff +++ b/testdata/baselines/reference/submodule/compiler/voidUndefinedReduction.types.diff @@ -9,16 +9,7 @@ >value : void | T | null | undefined return value !== undefined && value !== null; -@@= skipped -9, +9 lines =@@ - >value : void | T | null | undefined - >undefined : undefined - >value !== null : boolean -->value : (T & {}) | null -+>value : T & {} | null - } - - declare const foo: string | undefined; -@@= skipped -8, +8 lines =@@ +@@= skipped -17, +17 lines =@@ if (isDefined(foo)) { >isDefined(foo) : boolean diff --git a/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types b/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types index 723a3b8933..03da018ff8 100644 --- a/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types +++ b/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types @@ -106,7 +106,7 @@ function c(data: string | T): T { >JSON.parse : (text: string, reviver?: (this: any, key: string, value: any) => any) => any >JSON : JSON >parse : (text: string, reviver?: (this: any, key: string, value: any) => any) => any ->data : string | T & string +>data : string | (T & string) } else { return data; diff --git a/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types.diff b/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types.diff deleted file mode 100644 index 118caab64d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/controlFlowIfStatement.types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.controlFlowIfStatement.types -+++ new.controlFlowIfStatement.types -@@= skipped -105, +105 lines =@@ - >JSON.parse : (text: string, reviver?: (this: any, key: string, value: any) => any) => any - >JSON : JSON - >parse : (text: string, reviver?: (this: any, key: string, value: any) => any) => any -->data : string | (T & string) -+>data : string | T & string - } - else { - return data; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types b/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types index 08c9e6c191..74a13972ee 100644 --- a/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types +++ b/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types @@ -382,15 +382,15 @@ function foo1(x: RuntimeValue & { type: 'number' }) { } function foo2(x: RuntimeValue & ({ type: 'number' } | { type: 'string' })) { ->foo2 : (x: { type: "number"; value: number; } & { type: "number"; } | { type: "string"; value: string; } & { type: "string"; }) => void ->x : { type: "number"; value: number; } & { type: "number"; } | { type: "string"; value: string; } & { type: "string"; } +>foo2 : (x: ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; })) => void +>x : ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; }) >type : "number" >type : "string" if (x.type === 'number') { >x.type === 'number' : boolean >x.type : "number" | "string" ->x : { type: "number"; value: number; } & { type: "number"; } | { type: "string"; value: string; } & { type: "string"; } +>x : ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; }) >type : "number" | "string" >'number' : "number" diff --git a/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types.diff b/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types.diff index 8ba6dc8bef..dbb863f62a 100644 --- a/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types.diff +++ b/testdata/baselines/reference/submodule/conformance/discriminatedUnionTypes2.types.diff @@ -23,16 +23,7 @@ function foo2(x: RuntimeValue & ({ type: 'number' } | { type: 'string' })) { ->foo2 : (x: RuntimeValue & ({ type: "number"; } | { type: "string"; })) => void -->x : ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; }) -+>foo2 : (x: { type: "number"; value: number; } & { type: "number"; } | { type: "string"; value: string; } & { type: "string"; }) => void -+>x : { type: "number"; value: number; } & { type: "number"; } | { type: "string"; value: string; } & { type: "string"; } ++>foo2 : (x: ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; })) => void + >x : ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; }) >type : "number" - >type : "string" - - if (x.type === 'number') { - >x.type === 'number' : boolean - >x.type : "number" | "string" -->x : ({ type: "number"; value: number; } & { type: "number"; }) | ({ type: "string"; value: string; } & { type: "string"; }) -+>x : { type: "number"; value: number; } & { type: "number"; } | { type: "string"; value: string; } & { type: "string"; } - >type : "number" | "string" - >'number' : "number" + >type : "string" \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types b/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types index fb0d700541..a49d73efce 100644 --- a/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types +++ b/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types @@ -70,9 +70,9 @@ namespace Directive { >value : T | Directive >"number" : "number" >Directive[value] != null : boolean ->Directive[value] : typeof Directive[Directive | T & number] +>Directive[value] : typeof Directive[Directive | (T & number)] >Directive : typeof Directive ->value : Directive | T & number +>value : Directive | (T & number) } } diff --git a/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types.diff b/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types.diff index ca7da0060c..ce96977cc7 100644 --- a/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types.diff +++ b/testdata/baselines/reference/submodule/conformance/generatorYieldContextualType.types.diff @@ -30,13 +30,10 @@ >"number" : "number" >Directive[value] != null : boolean ->Directive[value] : (typeof Directive)[Directive | (T & number)] -+>Directive[value] : typeof Directive[Directive | T & number] ++>Directive[value] : typeof Directive[Directive | (T & number)] >Directive : typeof Directive -->value : Directive | (T & number) -+>value : Directive | T & number + >value : Directive | (T & number) } - } - @@= skipped -122, +122 lines =@@ }; diff --git a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt b/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt index 3d03c47934..69450109b9 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt @@ -2,23 +2,23 @@ intersectionAndUnionTypes.ts(19,1): error TS2322: Type 'A' is not assignable to Property 'b' is missing in type 'A' but required in type 'B'. intersectionAndUnionTypes.ts(20,1): error TS2322: Type 'B' is not assignable to type 'A & B'. Property 'a' is missing in type 'B' but required in type 'A'. -intersectionAndUnionTypes.ts(23,1): error TS2322: Type 'A | B' is not assignable to type 'A & B | C & D'. - Type 'A' is not assignable to type 'A & B | C & D'. +intersectionAndUnionTypes.ts(23,1): error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'. + Type 'A' is not assignable to type '(A & B) | (C & D)'. Type 'A' is not assignable to type 'A & B'. Property 'b' is missing in type 'A' but required in type 'B'. -intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type 'A & B | C & D'. - Type 'C' is not assignable to type 'A & B | C & D'. +intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. + Type 'C' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type 'C & D'. Property 'd' is missing in type 'C' but required in type 'D'. -intersectionAndUnionTypes.ts(26,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'A & B'. +intersectionAndUnionTypes.ts(26,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. Type 'C & D' is not assignable to type 'A & B'. Property 'a' is missing in type 'C & D' but required in type 'A'. -intersectionAndUnionTypes.ts(27,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'A | B'. +intersectionAndUnionTypes.ts(27,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'A | B'. -intersectionAndUnionTypes.ts(28,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'C & D'. +intersectionAndUnionTypes.ts(28,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. Type 'A & B' is not assignable to type 'C & D'. Property 'c' is missing in type 'A & B' but required in type 'C'. -intersectionAndUnionTypes.ts(29,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'C | D'. +intersectionAndUnionTypes.ts(29,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'C | D'. intersectionAndUnionTypes.ts(31,1): error TS2322: Type 'A & B' is not assignable to type '(A | B) & (C | D)'. Type 'A & B' is not assignable to type 'B & D'. @@ -75,38 +75,38 @@ intersectionAndUnionTypes.ts(37,1): error TS2322: Type '(A | B) & (C | D)' is no x = anb; // Ok x = aob; ~ -!!! error TS2322: Type 'A | B' is not assignable to type 'A & B | C & D'. -!!! error TS2322: Type 'A' is not assignable to type 'A & B | C & D'. +!!! error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'. +!!! error TS2322: Type 'A' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'A' is not assignable to type 'A & B'. !!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'. !!! related TS2728 intersectionAndUnionTypes.ts:2:15: 'b' is declared here. x = cnd; // Ok x = cod; ~ -!!! error TS2322: Type 'C | D' is not assignable to type 'A & B | C & D'. -!!! error TS2322: Type 'C' is not assignable to type 'A & B | C & D'. +!!! error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. +!!! error TS2322: Type 'C' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'C' is not assignable to type 'C & D'. !!! error TS2322: Property 'd' is missing in type 'C' but required in type 'D'. !!! related TS2728 intersectionAndUnionTypes.ts:4:15: 'd' is declared here. anb = x; ~~~ -!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'A & B'. +!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A & B'. !!! error TS2322: Property 'a' is missing in type 'C & D' but required in type 'A'. !!! related TS2728 intersectionAndUnionTypes.ts:1:15: 'a' is declared here. aob = x; ~~~ -!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'A | B'. +!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A | B'. cnd = x; ~~~ -!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'C & D'. +!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C & D'. !!! error TS2322: Property 'c' is missing in type 'A & B' but required in type 'C'. !!! related TS2728 intersectionAndUnionTypes.ts:3:15: 'c' is declared here. cod = x; ~~~ -!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'C | D'. +!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C | D'. y = anb; diff --git a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt.diff deleted file mode 100644 index 2a8ddf29ad..0000000000 --- a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.errors.txt.diff +++ /dev/null @@ -1,81 +0,0 @@ ---- old.intersectionAndUnionTypes.errors.txt -+++ new.intersectionAndUnionTypes.errors.txt -@@= skipped -1, +1 lines =@@ - Property 'b' is missing in type 'A' but required in type 'B'. - intersectionAndUnionTypes.ts(20,1): error TS2322: Type 'B' is not assignable to type 'A & B'. - Property 'a' is missing in type 'B' but required in type 'A'. --intersectionAndUnionTypes.ts(23,1): error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'. -- Type 'A' is not assignable to type '(A & B) | (C & D)'. -+intersectionAndUnionTypes.ts(23,1): error TS2322: Type 'A | B' is not assignable to type 'A & B | C & D'. -+ Type 'A' is not assignable to type 'A & B | C & D'. - Type 'A' is not assignable to type 'A & B'. - Property 'b' is missing in type 'A' but required in type 'B'. --intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. -- Type 'C' is not assignable to type '(A & B) | (C & D)'. -+intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type 'A & B | C & D'. -+ Type 'C' is not assignable to type 'A & B | C & D'. - Type 'C' is not assignable to type 'C & D'. - Property 'd' is missing in type 'C' but required in type 'D'. --intersectionAndUnionTypes.ts(26,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. -+intersectionAndUnionTypes.ts(26,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'A & B'. - Type 'C & D' is not assignable to type 'A & B'. - Property 'a' is missing in type 'C & D' but required in type 'A'. --intersectionAndUnionTypes.ts(27,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. -+intersectionAndUnionTypes.ts(27,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'A | B'. - Type 'C & D' is not assignable to type 'A | B'. --intersectionAndUnionTypes.ts(28,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. -+intersectionAndUnionTypes.ts(28,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'C & D'. - Type 'A & B' is not assignable to type 'C & D'. - Property 'c' is missing in type 'A & B' but required in type 'C'. --intersectionAndUnionTypes.ts(29,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. -+intersectionAndUnionTypes.ts(29,1): error TS2322: Type 'A & B | C & D' is not assignable to type 'C | D'. - Type 'A & B' is not assignable to type 'C | D'. - intersectionAndUnionTypes.ts(31,1): error TS2322: Type 'A & B' is not assignable to type '(A | B) & (C | D)'. - Type 'A & B' is not assignable to type 'B & D'. -@@= skipped -73, +73 lines =@@ - x = anb; // Ok - x = aob; - ~ --!!! error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'. --!!! error TS2322: Type 'A' is not assignable to type '(A & B) | (C & D)'. -+!!! error TS2322: Type 'A | B' is not assignable to type 'A & B | C & D'. -+!!! error TS2322: Type 'A' is not assignable to type 'A & B | C & D'. - !!! error TS2322: Type 'A' is not assignable to type 'A & B'. - !!! error TS2322: Property 'b' is missing in type 'A' but required in type 'B'. - !!! related TS2728 intersectionAndUnionTypes.ts:2:15: 'b' is declared here. - x = cnd; // Ok - x = cod; - ~ --!!! error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. --!!! error TS2322: Type 'C' is not assignable to type '(A & B) | (C & D)'. -+!!! error TS2322: Type 'C | D' is not assignable to type 'A & B | C & D'. -+!!! error TS2322: Type 'C' is not assignable to type 'A & B | C & D'. - !!! error TS2322: Type 'C' is not assignable to type 'C & D'. - !!! error TS2322: Property 'd' is missing in type 'C' but required in type 'D'. - !!! related TS2728 intersectionAndUnionTypes.ts:4:15: 'd' is declared here. - anb = x; - ~~~ --!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. -+!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'A & B'. - !!! error TS2322: Type 'C & D' is not assignable to type 'A & B'. - !!! error TS2322: Property 'a' is missing in type 'C & D' but required in type 'A'. - !!! related TS2728 intersectionAndUnionTypes.ts:1:15: 'a' is declared here. - aob = x; - ~~~ --!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. -+!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'A | B'. - !!! error TS2322: Type 'C & D' is not assignable to type 'A | B'. - cnd = x; - ~~~ --!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. -+!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'C & D'. - !!! error TS2322: Type 'A & B' is not assignable to type 'C & D'. - !!! error TS2322: Property 'c' is missing in type 'A & B' but required in type 'C'. - !!! related TS2728 intersectionAndUnionTypes.ts:3:15: 'c' is declared here. - cod = x; - ~~~ --!!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. -+!!! error TS2322: Type 'A & B | C & D' is not assignable to type 'C | D'. - !!! error TS2322: Type 'A & B' is not assignable to type 'C | D'. - - y = anb; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types b/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types index 68dfe52f70..7cfa1d9856 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types +++ b/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types @@ -38,7 +38,7 @@ var cod: C | D; >cod : C | D var x: A & B | C & D; ->x : A & B | C & D +>x : (A & B) | (C & D) var y: (A | B) & (C | D); >y : (A | B) & (C | D) @@ -65,43 +65,43 @@ anb = b; x = anb; // Ok >x = anb : A & B ->x : A & B | C & D +>x : (A & B) | (C & D) >anb : A & B x = aob; >x = aob : A | B ->x : A & B | C & D +>x : (A & B) | (C & D) >aob : A | B x = cnd; // Ok >x = cnd : C & D ->x : A & B | C & D +>x : (A & B) | (C & D) >cnd : C & D x = cod; >x = cod : C | D ->x : A & B | C & D +>x : (A & B) | (C & D) >cod : C | D anb = x; ->anb = x : A & B | C & D +>anb = x : (A & B) | (C & D) >anb : A & B ->x : A & B | C & D +>x : (A & B) | (C & D) aob = x; ->aob = x : A & B | C & D +>aob = x : (A & B) | (C & D) >aob : A | B ->x : A & B | C & D +>x : (A & B) | (C & D) cnd = x; ->cnd = x : A & B | C & D +>cnd = x : (A & B) | (C & D) >cnd : C & D ->x : A & B | C & D +>x : (A & B) | (C & D) cod = x; ->cod = x : A & B | C & D +>cod = x : (A & B) | (C & D) >cod : C | D ->x : A & B | C & D +>x : (A & B) | (C & D) y = anb; >y = anb : A & B diff --git a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types.diff b/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types.diff deleted file mode 100644 index 89aa87af10..0000000000 --- a/testdata/baselines/reference/submodule/conformance/intersectionAndUnionTypes.types.diff +++ /dev/null @@ -1,67 +0,0 @@ ---- old.intersectionAndUnionTypes.types -+++ new.intersectionAndUnionTypes.types -@@= skipped -37, +37 lines =@@ - >cod : C | D - - var x: A & B | C & D; -->x : (A & B) | (C & D) -+>x : A & B | C & D - - var y: (A | B) & (C | D); - >y : (A | B) & (C | D) -@@= skipped -27, +27 lines =@@ - - x = anb; // Ok - >x = anb : A & B -->x : (A & B) | (C & D) -+>x : A & B | C & D - >anb : A & B - - x = aob; - >x = aob : A | B -->x : (A & B) | (C & D) -+>x : A & B | C & D - >aob : A | B - - x = cnd; // Ok - >x = cnd : C & D -->x : (A & B) | (C & D) -+>x : A & B | C & D - >cnd : C & D - - x = cod; - >x = cod : C | D -->x : (A & B) | (C & D) -+>x : A & B | C & D - >cod : C | D - - anb = x; -->anb = x : (A & B) | (C & D) -+>anb = x : A & B | C & D - >anb : A & B -->x : (A & B) | (C & D) -+>x : A & B | C & D - - aob = x; -->aob = x : (A & B) | (C & D) -+>aob = x : A & B | C & D - >aob : A | B -->x : (A & B) | (C & D) -+>x : A & B | C & D - - cnd = x; -->cnd = x : (A & B) | (C & D) -+>cnd = x : A & B | C & D - >cnd : C & D -->x : (A & B) | (C & D) -+>x : A & B | C & D - - cod = x; -->cod = x : (A & B) | (C & D) -+>cod = x : A & B | C & D - >cod : C | D -->x : (A & B) | (C & D) -+>x : A & B | C & D - - y = anb; - >y = anb : A & B \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types b/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types index 247df157bf..a0eef45bfc 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types +++ b/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types @@ -4,11 +4,11 @@ // Repros from #43130 function f1(x: T & string | T & undefined) { ->f1 : (x: T & undefined | T & string) => void ->x : T & undefined | T & string +>f1 : (x: (T & undefined) | (T & string)) => void +>x : (T & undefined) | (T & string) if (x) { ->x : T & undefined | T & string +>x : (T & undefined) | (T & string) x; // Should narrow to T & string >x : T & string @@ -16,12 +16,12 @@ function f1(x: T & string | T & undefined) { } function f2(x: T & string | T & undefined) { ->f2 : (x: T & undefined | T & string) => void ->x : T & undefined | T & string +>f2 : (x: (T & undefined) | (T & string)) => void +>x : (T & undefined) | (T & string) if (x !== undefined) { >x !== undefined : boolean ->x : T & undefined | T & string +>x : (T & undefined) | (T & string) >undefined : undefined x; // Should narrow to T & string @@ -34,13 +34,13 @@ function f2(x: T & string | T & undefined) { } function f3(x: T & string | T & number) { ->f3 : (x: T & string | T & number) => void ->x : T & string | T & number +>f3 : (x: (T & string) | (T & number)) => void +>x : (T & string) | (T & number) if (typeof x === "string") { >typeof x === "string" : boolean >typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" ->x : T & string | T & number +>x : (T & string) | (T & number) >"string" : "string" x; // Should narrow to T & string @@ -53,11 +53,11 @@ function f3(x: T & string | T & number) { } function f4(x: T & 1 | T & 2) { ->f4 : (x: T & 1 | T & 2) => void ->x : T & 1 | T & 2 +>f4 : (x: (T & 1) | (T & 2)) => void +>x : (T & 1) | (T & 2) switch (x) { ->x : T & 1 | T & 2 +>x : (T & 1) | (T & 2) case 1: x; break; // T & 1 >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types.diff b/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types.diff index f0ddd2d804..b8ce96b1d4 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types.diff +++ b/testdata/baselines/reference/submodule/conformance/intersectionNarrowing.types.diff @@ -5,61 +5,16 @@ function f1(x: T & string | T & undefined) { ->f1 : (x: (T & string) | (T & undefined)) => void -->x : (T & undefined) | (T & string) -+>f1 : (x: T & undefined | T & string) => void -+>x : T & undefined | T & string ++>f1 : (x: (T & undefined) | (T & string)) => void + >x : (T & undefined) | (T & string) if (x) { -->x : (T & undefined) | (T & string) -+>x : T & undefined | T & string - - x; // Should narrow to T & string - >x : T & string @@= skipped -12, +12 lines =@@ } function f2(x: T & string | T & undefined) { ->f2 : (x: (T & string) | (T & undefined)) => void -->x : (T & undefined) | (T & string) -+>f2 : (x: T & undefined | T & string) => void -+>x : T & undefined | T & string - - if (x !== undefined) { - >x !== undefined : boolean -->x : (T & undefined) | (T & string) -+>x : T & undefined | T & string - >undefined : undefined - - x; // Should narrow to T & string -@@= skipped -18, +18 lines =@@ - } - - function f3(x: T & string | T & number) { -->f3 : (x: (T & string) | (T & number)) => void -->x : (T & string) | (T & number) -+>f3 : (x: T & string | T & number) => void -+>x : T & string | T & number - - if (typeof x === "string") { - >typeof x === "string" : boolean - >typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" -->x : (T & string) | (T & number) -+>x : T & string | T & number - >"string" : "string" - - x; // Should narrow to T & string -@@= skipped -19, +19 lines =@@ - } - - function f4(x: T & 1 | T & 2) { -->f4 : (x: (T & 1) | (T & 2)) => void -->x : (T & 1) | (T & 2) -+>f4 : (x: T & 1 | T & 2) => void -+>x : T & 1 | T & 2 - - switch (x) { -->x : (T & 1) | (T & 2) -+>x : T & 1 | T & 2 ++>f2 : (x: (T & undefined) | (T & string)) => void + >x : (T & undefined) | (T & string) - case 1: x; break; // T & 1 - >1 : 1 \ No newline at end of file + if (x !== undefined) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types b/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types index 0cedab2aa7..a092948b57 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types +++ b/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types @@ -22,9 +22,9 @@ declare const q: X & AorB; if (q.a !== undefined) { >q.a !== undefined : boolean ->q.a : { aProp: string; } & object | undefined +>q.a : ({ aProp: string; } & object) | undefined >q : X & AorB ->a : { aProp: string; } & object | undefined +>a : ({ aProp: string; } & object) | undefined >undefined : undefined q.a.aProp; diff --git a/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types.diff b/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types.diff deleted file mode 100644 index c1de63cfe1..0000000000 --- a/testdata/baselines/reference/submodule/conformance/intersectionOfUnionNarrowing.types.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.intersectionOfUnionNarrowing.types -+++ new.intersectionOfUnionNarrowing.types -@@= skipped -21, +21 lines =@@ - - if (q.a !== undefined) { - >q.a !== undefined : boolean -->q.a : ({ aProp: string; } & object) | undefined -+>q.a : { aProp: string; } & object | undefined - >q : X & AorB -->a : ({ aProp: string; } & object) | undefined -+>a : { aProp: string; } & object | undefined - >undefined : undefined - - q.a.aProp; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types b/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types index d5bba2c83a..93cfdcc52c 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types +++ b/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types @@ -44,8 +44,8 @@ type T1 = (string | number | undefined) & (string | null | undefined); // strin >T1 : string | undefined function f3(x: T & (number | object | undefined)) { ->f3 : (x: T & undefined | T & number) => void ->x : T & undefined | T & number +>f3 : (x: (T & undefined) | (T & number)) => void +>x : (T & undefined) | (T & number) const y: number | undefined = x; >y : number | undefined diff --git a/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types.diff b/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types.diff index 78d1c6d412..f843d5d4a8 100644 --- a/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types.diff +++ b/testdata/baselines/reference/submodule/conformance/intersectionWithUnionConstraint.types.diff @@ -5,12 +5,10 @@ function f3(x: T & (number | object | undefined)) { ->f3 : (x: T & (number | object | undefined)) => void -->x : (T & undefined) | (T & number) -+>f3 : (x: T & undefined | T & number) => void -+>x : T & undefined | T & number ++>f3 : (x: (T & undefined) | (T & number)) => void + >x : (T & undefined) | (T & number) const y: number | undefined = x; - >y : number | undefined @@= skipped -9, +9 lines =@@ } diff --git a/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types b/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types index c1ca5d2422..0602e87d7c 100644 --- a/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types +++ b/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types @@ -566,7 +566,7 @@ for (const action of actions) { window[action](x, y); >window[action](x, y) : void ->window[action] : ((x: number, y: number) => void) & ((x: number, y: number) => void) | ((width: number, height: number) => void) & ((width: number, height: number) => void) +>window[action] : (((x: number, y: number) => void) & ((x: number, y: number) => void)) | (((width: number, height: number) => void) & ((width: number, height: number) => void)) >window : Window & typeof globalThis >action : "resizeBy" | "resizeTo" >x : number diff --git a/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types.diff b/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types.diff index e05aaa8a96..a0e1ed337a 100644 --- a/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types.diff +++ b/testdata/baselines/reference/submodule/conformance/keyofAndIndexedAccess2.types.diff @@ -81,13 +81,4 @@ +>fn3 : (param: T, cb: (element: T[number]) => void) => void >param : T >cb : (element: T[number]) => void - >element : T[number] -@@= skipped -90, +90 lines =@@ - - window[action](x, y); - >window[action](x, y) : void -->window[action] : (((x: number, y: number) => void) & ((x: number, y: number) => void)) | (((width: number, height: number) => void) & ((width: number, height: number) => void)) -+>window[action] : ((x: number, y: number) => void) & ((x: number, y: number) => void) | ((width: number, height: number) => void) & ((width: number, height: number) => void) - >window : Window & typeof globalThis - >action : "resizeBy" | "resizeTo" - >x : number \ No newline at end of file + >element : T[number] \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/mappedTypes4.types b/testdata/baselines/reference/submodule/conformance/mappedTypes4.types index fcbdf252e9..9f739b2323 100644 --- a/testdata/baselines/reference/submodule/conformance/mappedTypes4.types +++ b/testdata/baselines/reference/submodule/conformance/mappedTypes4.types @@ -29,7 +29,7 @@ function boxify(obj: T): Boxified { for (let k in obj) { >k : Extract ->obj : T & null | T & object +>obj : (T & null) | (T & object) result[k] = { value: obj[k] }; >result[k] = { value: obj[k] } : { value: (T & object)[Extract]; } diff --git a/testdata/baselines/reference/submodule/conformance/mappedTypes4.types.diff b/testdata/baselines/reference/submodule/conformance/mappedTypes4.types.diff deleted file mode 100644 index e323cb2082..0000000000 --- a/testdata/baselines/reference/submodule/conformance/mappedTypes4.types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.mappedTypes4.types -+++ new.mappedTypes4.types -@@= skipped -28, +28 lines =@@ - - for (let k in obj) { - >k : Extract -->obj : (T & null) | (T & object) -+>obj : T & null | T & object - - result[k] = { value: obj[k] }; - >result[k] = { value: obj[k] } : { value: (T & object)[Extract]; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types b/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types index 39b39b7381..b357cc5d53 100644 --- a/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types +++ b/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types @@ -10,7 +10,7 @@ export interface BarProps { export interface FooProps { fooProps?: BarProps & object; ->fooProps : BarProps & object | undefined +>fooProps : (BarProps & object) | undefined } declare const foo: FooProps; diff --git a/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types.diff b/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types.diff deleted file mode 100644 index 224cce581f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nonPrimitiveAndEmptyObject.types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.nonPrimitiveAndEmptyObject.types -+++ new.nonPrimitiveAndEmptyObject.types -@@= skipped -9, +9 lines =@@ - - export interface FooProps { - fooProps?: BarProps & object; -->fooProps : (BarProps & object) | undefined -+>fooProps : BarProps & object | undefined - } - - declare const foo: FooProps; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/objectSpread.types b/testdata/baselines/reference/submodule/conformance/objectSpread.types index c79e0af4c7..e35a2b452d 100644 --- a/testdata/baselines/reference/submodule/conformance/objectSpread.types +++ b/testdata/baselines/reference/submodule/conformance/objectSpread.types @@ -672,8 +672,8 @@ function genericSpread(t: T, u: U, v: T | U, w: T | { s: string }, obj: { >v : T | U let x12 = { ...v, ...obj }; ->x12 : T & { x: number; } | U & { x: number; } ->{ ...v, ...obj } : T & { x: number; } | U & { x: number; } +>x12 : (T & { x: number; }) | (U & { x: number; }) +>{ ...v, ...obj } : (T & { x: number; }) | (U & { x: number; }) >v : T | U >obj : { x: number; } @@ -683,33 +683,33 @@ function genericSpread(t: T, u: U, v: T | U, w: T | { s: string }, obj: { >w : T | { s: string; } let x14 = { ...w, ...obj }; ->x14 : { s: string; x: number; } | T & { x: number; } ->{ ...w, ...obj } : { s: string; x: number; } | T & { x: number; } +>x14 : { s: string; x: number; } | (T & { x: number; }) +>{ ...w, ...obj } : { s: string; x: number; } | (T & { x: number; }) >w : T | { s: string; } >obj : { x: number; } let x15 = { ...t, ...v }; ->x15 : T | T & U ->{ ...t, ...v } : T | T & U +>x15 : T | (T & U) +>{ ...t, ...v } : T | (T & U) >t : T >v : T | U let x16 = { ...t, ...w }; ->x16 : T | T & { s: string; } ->{ ...t, ...w } : T | T & { s: string; } +>x16 : T | (T & { s: string; }) +>{ ...t, ...w } : T | (T & { s: string; }) >t : T >w : T | { s: string; } let x17 = { ...t, ...w, ...obj }; ->x17 : T & { x: number; } | T & { s: string; x: number; } ->{ ...t, ...w, ...obj } : T & { x: number; } | T & { s: string; x: number; } +>x17 : (T & { x: number; }) | (T & { s: string; x: number; }) +>{ ...t, ...w, ...obj } : (T & { x: number; }) | (T & { s: string; x: number; }) >t : T >w : T | { s: string; } >obj : { x: number; } let x18 = { ...t, ...v, ...w }; ->x18 : T | T & U | T & { s: string; } | T & U & { s: string; } ->{ ...t, ...v, ...w } : T | T & U | T & { s: string; } | T & U & { s: string; } +>x18 : T | (T & U) | (T & { s: string; }) | (T & U & { s: string; }) +>{ ...t, ...v, ...w } : T | (T & U) | (T & { s: string; }) | (T & U & { s: string; }) >t : T >v : T | U >w : T | { s: string; } diff --git a/testdata/baselines/reference/submodule/conformance/objectSpread.types.diff b/testdata/baselines/reference/submodule/conformance/objectSpread.types.diff index 6039df0a1e..12114244a3 100644 --- a/testdata/baselines/reference/submodule/conformance/objectSpread.types.diff +++ b/testdata/baselines/reference/submodule/conformance/objectSpread.types.diff @@ -52,59 +52,4 @@ +>optionalNumber : { sn?: number | undefined; } // computed property - let computedFirst: { a: number, b: string, "before everything": number } = -@@= skipped -244, +244 lines =@@ - >v : T | U - - let x12 = { ...v, ...obj }; -->x12 : (T & { x: number; }) | (U & { x: number; }) -->{ ...v, ...obj } : (T & { x: number; }) | (U & { x: number; }) -+>x12 : T & { x: number; } | U & { x: number; } -+>{ ...v, ...obj } : T & { x: number; } | U & { x: number; } - >v : T | U - >obj : { x: number; } - -@@= skipped -11, +11 lines =@@ - >w : T | { s: string; } - - let x14 = { ...w, ...obj }; -->x14 : { s: string; x: number; } | (T & { x: number; }) -->{ ...w, ...obj } : { s: string; x: number; } | (T & { x: number; }) -+>x14 : { s: string; x: number; } | T & { x: number; } -+>{ ...w, ...obj } : { s: string; x: number; } | T & { x: number; } - >w : T | { s: string; } - >obj : { x: number; } - - let x15 = { ...t, ...v }; -->x15 : T | (T & U) -->{ ...t, ...v } : T | (T & U) -+>x15 : T | T & U -+>{ ...t, ...v } : T | T & U - >t : T - >v : T | U - - let x16 = { ...t, ...w }; -->x16 : T | (T & { s: string; }) -->{ ...t, ...w } : T | (T & { s: string; }) -+>x16 : T | T & { s: string; } -+>{ ...t, ...w } : T | T & { s: string; } - >t : T - >w : T | { s: string; } - - let x17 = { ...t, ...w, ...obj }; -->x17 : (T & { x: number; }) | (T & { s: string; x: number; }) -->{ ...t, ...w, ...obj } : (T & { x: number; }) | (T & { s: string; x: number; }) -+>x17 : T & { x: number; } | T & { s: string; x: number; } -+>{ ...t, ...w, ...obj } : T & { x: number; } | T & { s: string; x: number; } - >t : T - >w : T | { s: string; } - >obj : { x: number; } - - let x18 = { ...t, ...v, ...w }; -->x18 : T | (T & U) | (T & { s: string; }) | (T & U & { s: string; }) -->{ ...t, ...v, ...w } : T | (T & U) | (T & { s: string; }) | (T & U & { s: string; }) -+>x18 : T | T & U | T & { s: string; } | T & U & { s: string; } -+>{ ...t, ...v, ...w } : T | T & U | T & { s: string; } | T & U & { s: string; } - >t : T - >v : T | U - >w : T | { s: string; } \ No newline at end of file + let computedFirst: { a: number, b: string, "before everything": number } = \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js index 0c5fa33708..127c238252 100644 --- a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js +++ b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js @@ -94,7 +94,7 @@ class Foo { //// [spreadObjectOrFalsy.d.ts] declare function f1(a: T & undefined): any; -declare function f2(a: T | T & undefined): T | T & undefined; +declare function f2(a: T | (T & undefined)): T | (T & undefined); declare function f3(a: T): any; declare function f4(a: object | T): {}; declare function f5(a: S | T): S | T; diff --git a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js.diff b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js.diff index 55a888d349..ad293c9e65 100644 --- a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js.diff +++ b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.js.diff @@ -58,7 +58,7 @@ //// [spreadObjectOrFalsy.d.ts] declare function f1(a: T & undefined): any; -declare function f2(a: T | T & undefined): T | (T & undefined); -+declare function f2(a: T | T & undefined): T | T & undefined; ++declare function f2(a: T | (T & undefined)): T | (T & undefined); declare function f3(a: T): any; declare function f4(a: object | T): {}; declare function f5(a: S | T): S | T; diff --git a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types index 270318d4fe..fef37c9a6a 100644 --- a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types +++ b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types @@ -11,12 +11,12 @@ function f1(a: T & undefined) { } function f2(a: T | T & undefined) { ->f2 : (a: T | T & undefined) => T | T & undefined ->a : T | T & undefined +>f2 : (a: T | (T & undefined)) => T | (T & undefined) +>a : T | (T & undefined) return { ...a }; ->{ ...a } : T | T & undefined ->a : T | T & undefined +>{ ...a } : T | (T & undefined) +>a : T | (T & undefined) } function f3(a: T) { diff --git a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types.diff b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types.diff index 9e6404ed0e..64a745c098 100644 --- a/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types.diff +++ b/testdata/baselines/reference/submodule/conformance/spreadObjectOrFalsy.types.diff @@ -1,23 +1,6 @@ --- old.spreadObjectOrFalsy.types +++ new.spreadObjectOrFalsy.types -@@= skipped -10, +10 lines =@@ - } - - function f2(a: T | T & undefined) { -->f2 : (a: T | (T & undefined)) => T | (T & undefined) -->a : T | (T & undefined) -+>f2 : (a: T | T & undefined) => T | T & undefined -+>a : T | T & undefined - - return { ...a }; -->{ ...a } : T | (T & undefined) -->a : T | (T & undefined) -+>{ ...a } : T | T & undefined -+>a : T | T & undefined - } - - function f3(a: T) { -@@= skipped -47, +47 lines =@@ +@@= skipped -57, +57 lines =@@ // Repro from #46976 function g1(a: A) { diff --git a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types index 7083c95b64..9f142ccbd8 100644 --- a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types +++ b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types @@ -403,13 +403,13 @@ const interpolatedStyle = { rotate: 12 }; >12 : 12 function C2(transform: "-moz-initial" | (string & {})) { return 12; } ->C2 : (transform: "-moz-initial" | string & {}) => number ->transform : "-moz-initial" | string & {} +>C2 : (transform: "-moz-initial" | (string & {})) => number +>transform : "-moz-initial" | (string & {}) >12 : 12 C2(`rotate(${interpolatedStyle.rotate}dig)`); >C2(`rotate(${interpolatedStyle.rotate}dig)`) : number ->C2 : (transform: "-moz-initial" | string & {}) => number +>C2 : (transform: "-moz-initial" | (string & {})) => number >`rotate(${interpolatedStyle.rotate}dig)` : `rotate(${number}dig)` >interpolatedStyle.rotate : number >interpolatedStyle : { rotate: number; } diff --git a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types.diff b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types.diff index b98b9435bf..0695b36656 100644 --- a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types.diff +++ b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes2.types.diff @@ -8,21 +8,4 @@ +>ft1 : (s: string, n: number, u: "bar" | "baz" | "foo", t: T) => void >s : string >n : number - >u : "bar" | "baz" | "foo" -@@= skipped -401, +401 lines =@@ - >12 : 12 - - function C2(transform: "-moz-initial" | (string & {})) { return 12; } -->C2 : (transform: "-moz-initial" | (string & {})) => number -->transform : "-moz-initial" | (string & {}) -+>C2 : (transform: "-moz-initial" | string & {}) => number -+>transform : "-moz-initial" | string & {} - >12 : 12 - - C2(`rotate(${interpolatedStyle.rotate}dig)`); - >C2(`rotate(${interpolatedStyle.rotate}dig)`) : number -->C2 : (transform: "-moz-initial" | (string & {})) => number -+>C2 : (transform: "-moz-initial" | string & {}) => number - >`rotate(${interpolatedStyle.rotate}dig)` : `rotate(${number}dig)` - >interpolatedStyle.rotate : number - >interpolatedStyle : { rotate: number; } \ No newline at end of file + >u : "bar" | "baz" | "foo" \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types index 6f2290166e..a33d749d3b 100644 --- a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types +++ b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types @@ -608,16 +608,16 @@ function a() { >id : string let x: keyof T & string | `-${keyof T & string}`; ->x : `-${keyof T & string}` | keyof T & string +>x : `-${keyof T & string}` | (keyof T & string) x = "id"; >x = "id" : "id" ->x : `-${keyof T & string}` | keyof T & string +>x : `-${keyof T & string}` | (keyof T & string) >"id" : "id" x = "-id"; >x = "-id" : "-id" ->x : `-${keyof T & string}` | keyof T & string +>x : `-${keyof T & string}` | (keyof T & string) >"-id" : "-id" } diff --git a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types.diff b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types.diff index e3c5a47fed..8bce7669b0 100644 --- a/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types.diff +++ b/testdata/baselines/reference/submodule/conformance/templateLiteralTypes3.types.diff @@ -106,23 +106,4 @@ +>spread :

(...args: P[]) => P >u1 : `1.${Uppercase}.3` >u2 : `1.${Uppercase}.4` - } -@@= skipped -17, +17 lines =@@ - >id : string - - let x: keyof T & string | `-${keyof T & string}`; -->x : `-${keyof T & string}` | (keyof T & string) -+>x : `-${keyof T & string}` | keyof T & string - - x = "id"; - >x = "id" : "id" -->x : `-${keyof T & string}` | (keyof T & string) -+>x : `-${keyof T & string}` | keyof T & string - >"id" : "id" - - x = "-id"; - >x = "-id" : "-id" -->x : `-${keyof T & string}` | (keyof T & string) -+>x : `-${keyof T & string}` | keyof T & string - >"-id" : "-id" - } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types b/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types index 61ad1487be..b90cae9fa1 100644 --- a/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types +++ b/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types @@ -637,21 +637,21 @@ export abstract class BB { // repro from https://github.com/microsoft/TypeScript/issues/54177#issuecomment-1538436654 function conversionTest(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | `${string}Downcast` & {}) {} ->conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | `${string}Downcast` & {}) => void ->groupName : "dataDowncast" | "downcast" | "editingDowncast" | `${string}Downcast` & {} +>conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {})) => void +>groupName : "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {}) conversionTest("testDowncast"); >conversionTest("testDowncast") : void ->conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | `${string}Downcast` & {}) => void +>conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {})) => void >"testDowncast" : "testDowncast" function conversionTest2(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | {} & `${string}Downcast`) {} ->conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | {} & `${string}Downcast`) => void ->groupName : "dataDowncast" | "downcast" | "editingDowncast" | {} & `${string}Downcast` +>conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`)) => void +>groupName : "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`) conversionTest2("testDowncast"); >conversionTest2("testDowncast") : void ->conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | {} & `${string}Downcast`) => void +>conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`)) => void >"testDowncast" : "testDowncast" function conversionTest3(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | `${string & {}}Downcast`) {} diff --git a/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types.diff b/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types.diff index 0febbd4809..c595ea3000 100644 --- a/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types.diff +++ b/testdata/baselines/reference/submodule/conformance/templateLiteralTypesPatterns.types.diff @@ -139,26 +139,24 @@ // repro from https://github.com/microsoft/TypeScript/issues/54177#issuecomment-1538436654 function conversionTest(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | `${string}Downcast` & {}) {} ->conversionTest : (groupName: "downcast" | "dataDowncast" | "editingDowncast" | (`${string}Downcast` & {})) => void -->groupName : "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {}) -+>conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | `${string}Downcast` & {}) => void -+>groupName : "dataDowncast" | "downcast" | "editingDowncast" | `${string}Downcast` & {} ++>conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {})) => void + >groupName : "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {}) conversionTest("testDowncast"); >conversionTest("testDowncast") : void ->conversionTest : (groupName: "downcast" | "dataDowncast" | "editingDowncast" | (`${string}Downcast` & {})) => void -+>conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | `${string}Downcast` & {}) => void ++>conversionTest : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | (`${string}Downcast` & {})) => void >"testDowncast" : "testDowncast" function conversionTest2(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | {} & `${string}Downcast`) {} ->conversionTest2 : (groupName: "downcast" | "dataDowncast" | "editingDowncast" | ({} & `${string}Downcast`)) => void -->groupName : "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`) -+>conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | {} & `${string}Downcast`) => void -+>groupName : "dataDowncast" | "downcast" | "editingDowncast" | {} & `${string}Downcast` ++>conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`)) => void + >groupName : "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`) conversionTest2("testDowncast"); >conversionTest2("testDowncast") : void ->conversionTest2 : (groupName: "downcast" | "dataDowncast" | "editingDowncast" | ({} & `${string}Downcast`)) => void -+>conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | {} & `${string}Downcast`) => void ++>conversionTest2 : (groupName: "dataDowncast" | "downcast" | "editingDowncast" | ({} & `${string}Downcast`)) => void >"testDowncast" : "testDowncast" function conversionTest3(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | `${string & {}}Downcast`) {} diff --git a/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types b/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types index 8a6f12fb0c..e310cff9af 100644 --- a/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types +++ b/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types @@ -406,7 +406,7 @@ type ObjectDescriptor = { >data : D | undefined methods?: M & ThisType; // Type of 'this' in methods is D & M ->methods : M & ThisType | undefined +>methods : (M & ThisType) | undefined } declare function makeObject(desc: ObjectDescriptor): D & M; diff --git a/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types.diff b/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types.diff index 05b183c797..54977b8e1a 100644 --- a/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types.diff +++ b/testdata/baselines/reference/submodule/conformance/thisTypeInObjectLiterals2.types.diff @@ -8,13 +8,4 @@ +>moveBy : (dx: number, dy: number, dz?: number | undefined) => void >dx : number >dy : number - >dz : number | undefined -@@= skipped -320, +320 lines =@@ - >data : D | undefined - - methods?: M & ThisType; // Type of 'this' in methods is D & M -->methods : (M & ThisType) | undefined -+>methods : M & ThisType | undefined - } - - declare function makeObject(desc: ObjectDescriptor): D & M; \ No newline at end of file + >dz : number | undefined \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types b/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types index 8350f3ee0b..2cd1a1602b 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types +++ b/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types @@ -94,7 +94,7 @@ function isB(toTest: any): toTest is B { // a function that turns an A into an A & B function union(a: A): A & B | null { ->union : (a: A) => A & B | null +>union : (a: A) => (A & B) | null >a : A if (isB(a)) { diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types.diff b/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types.diff deleted file mode 100644 index 23b3e7bc04..0000000000 --- a/testdata/baselines/reference/submodule/conformance/typeGuardIntersectionTypes.types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.typeGuardIntersectionTypes.types -+++ new.typeGuardIntersectionTypes.types -@@= skipped -93, +93 lines =@@ - - // a function that turns an A into an A & B - function union(a: A): A & B | null { -->union : (a: A) => (A & B) | null -+>union : (a: A) => A & B | null - >a : A - - if (isB(a)) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt index a818f6deb9..a799f0e8d8 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt @@ -1,8 +1,8 @@ typeGuardsWithInstanceOf.ts(7,20): error TS2339: Property 'global' does not exist on type 'never'. The intersection 'I & RegExp' was reduced to 'never' because property 'global' has conflicting types in some constituents. -typeGuardsWithInstanceOf.ts(36,11): error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. +typeGuardsWithInstanceOf.ts(36,11): error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. Property 'onChanges' does not exist on type 'C'. -typeGuardsWithInstanceOf.ts(37,11): error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. +typeGuardsWithInstanceOf.ts(37,11): error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. Property 'onChanges' does not exist on type 'C'. @@ -47,11 +47,11 @@ typeGuardsWithInstanceOf.ts(37,11): error TS2339: Property 'onChanges' does not // before 4.1. if (v.onChanges) { ~~~~~~~~~ -!!! error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. +!!! error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. !!! error TS2339: Property 'onChanges' does not exist on type 'C'. v.onChanges({}); ~~~~~~~~~ -!!! error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. +!!! error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. !!! error TS2339: Property 'onChanges' does not exist on type 'C'. } } diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt.diff deleted file mode 100644 index 4f4fa6636d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.typeGuardsWithInstanceOf.errors.txt -+++ new.typeGuardsWithInstanceOf.errors.txt -@@= skipped -0, +0 lines =@@ - typeGuardsWithInstanceOf.ts(7,20): error TS2339: Property 'global' does not exist on type 'never'. - The intersection 'I & RegExp' was reduced to 'never' because property 'global' has conflicting types in some constituents. --typeGuardsWithInstanceOf.ts(36,11): error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. -+typeGuardsWithInstanceOf.ts(36,11): error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. - Property 'onChanges' does not exist on type 'C'. --typeGuardsWithInstanceOf.ts(37,11): error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. -+typeGuardsWithInstanceOf.ts(37,11): error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. - Property 'onChanges' does not exist on type 'C'. - - -@@= skipped -46, +46 lines =@@ - // before 4.1. - if (v.onChanges) { - ~~~~~~~~~ --!!! error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. -+!!! error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. - !!! error TS2339: Property 'onChanges' does not exist on type 'C'. - v.onChanges({}); - ~~~~~~~~~ --!!! error TS2339: Property 'onChanges' does not exist on type 'C | (Validator & Partial)'. -+!!! error TS2339: Property 'onChanges' does not exist on type 'C | Validator & Partial'. - !!! error TS2339: Property 'onChanges' does not exist on type 'C'. - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types index 9da6d9c20d..77624c555d 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types +++ b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types @@ -68,7 +68,7 @@ function foo() { >v : C } v // Validator & Partial via subtype reduction ->v : C | Validator & Partial +>v : C | (Validator & Partial) // In 4.1, we introduced a change which _fixed_ a bug with CFA // correctly setting this to be the right object. With 4.2, @@ -76,13 +76,13 @@ function foo() { // before 4.1. if (v.onChanges) { >v.onChanges : any ->v : C | Validator & Partial +>v : C | (Validator & Partial) >onChanges : any v.onChanges({}); >v.onChanges({}) : any >v.onChanges : any ->v : C | Validator & Partial +>v : C | (Validator & Partial) >onChanges : any >{} : {} } diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types.diff b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types.diff index 0363992816..67ecee0609 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types.diff +++ b/testdata/baselines/reference/submodule/conformance/typeGuardsWithInstanceOf.types.diff @@ -8,29 +8,4 @@ +>validate : () => Record | null } - class C { -@@= skipped -30, +30 lines =@@ - >v : C - } - v // Validator & Partial via subtype reduction -->v : C | (Validator & Partial) -+>v : C | Validator & Partial - - // In 4.1, we introduced a change which _fixed_ a bug with CFA - // correctly setting this to be the right object. With 4.2, -@@= skipped -8, +8 lines =@@ - // before 4.1. - if (v.onChanges) { - >v.onChanges : any -->v : C | (Validator & Partial) -+>v : C | Validator & Partial - >onChanges : any - - v.onChanges({}); - >v.onChanges({}) : any - >v.onChanges : any -->v : C | (Validator & Partial) -+>v : C | Validator & Partial - >onChanges : any - >{} : {} - } \ No newline at end of file + class C { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unionTypeInference.types b/testdata/baselines/reference/submodule/conformance/unionTypeInference.types index dcdca54235..c89ff9ef84 100644 --- a/testdata/baselines/reference/submodule/conformance/unionTypeInference.types +++ b/testdata/baselines/reference/submodule/conformance/unionTypeInference.types @@ -214,26 +214,26 @@ async function fun(deepPromised: DeepPromised) { >deepPromised : DeepPromised for (const value of Object.values(deepPromisedWithIndexer)) { ->value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | { [containsPromises]?: true | undefined; } & {} | null | undefined ->Object.values(deepPromisedWithIndexer) : (Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | { [containsPromises]?: true | undefined; } & {} | null | undefined)[] +>value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined +>Object.values(deepPromisedWithIndexer) : (Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined)[] >Object.values : { (o: ArrayLike | { [s: string]: T_1; }): T_1[]; (o: {}): any[]; } >Object : ObjectConstructor >values : { (o: ArrayLike | { [s: string]: T_1; }): T_1[]; (o: {}): any[]; } >deepPromisedWithIndexer : DeepPromised<{ [name: string]: {} | null | undefined; }> const awaitedValue = await value; ->awaitedValue : {} | { [containsPromises]?: true | undefined; } & {} | null | undefined ->await value : {} | { [containsPromises]?: true | undefined; } & {} | null | undefined ->value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | { [containsPromises]?: true | undefined; } & {} | null | undefined +>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined +>await value : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined +>value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined if (awaitedValue) ->awaitedValue : {} | { [containsPromises]?: true | undefined; } & {} | null | undefined +>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined await fun(awaitedValue); >await fun(awaitedValue) : void >fun(awaitedValue) : Promise >fun : (deepPromised: DeepPromised) => Promise ->awaitedValue : {} | { [containsPromises]?: true | undefined; } & {} +>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) } } diff --git a/testdata/baselines/reference/submodule/conformance/unionTypeInference.types.diff b/testdata/baselines/reference/submodule/conformance/unionTypeInference.types.diff index 6fd6c70a8e..188adf556a 100644 --- a/testdata/baselines/reference/submodule/conformance/unionTypeInference.types.diff +++ b/testdata/baselines/reference/submodule/conformance/unionTypeInference.types.diff @@ -7,8 +7,8 @@ ->value : Promise<{ [containsPromises]?: true; } & {}> | {} | ({ [containsPromises]?: true; } & {}) | null | undefined ->Object.values(deepPromisedWithIndexer) : (Promise<{ [containsPromises]?: true; } & {}> | {} | ({ [containsPromises]?: true; } & {}) | null | undefined)[] ->Object.values : { (o: { [s: string]: T_1; } | ArrayLike): T_1[]; (o: {}): any[]; } -+>value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | { [containsPromises]?: true | undefined; } & {} | null | undefined -+>Object.values(deepPromisedWithIndexer) : (Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | { [containsPromises]?: true | undefined; } & {} | null | undefined)[] ++>value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined ++>Object.values(deepPromisedWithIndexer) : (Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined)[] +>Object.values : { (o: ArrayLike | { [s: string]: T_1; }): T_1[]; (o: {}): any[]; } >Object : ObjectConstructor ->values : { (o: { [s: string]: T_1; } | ArrayLike): T_1[]; (o: {}): any[]; } @@ -19,19 +19,19 @@ ->awaitedValue : {} | ({ [containsPromises]?: true; } & {}) | null | undefined ->await value : {} | ({ [containsPromises]?: true; } & {}) | null | undefined ->value : Promise<{ [containsPromises]?: true; } & {}> | {} | ({ [containsPromises]?: true; } & {}) | null | undefined -+>awaitedValue : {} | { [containsPromises]?: true | undefined; } & {} | null | undefined -+>await value : {} | { [containsPromises]?: true | undefined; } & {} | null | undefined -+>value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | { [containsPromises]?: true | undefined; } & {} | null | undefined ++>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined ++>await value : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined ++>value : Promise<{ [containsPromises]?: true | undefined; } & {}> | {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined if (awaitedValue) ->awaitedValue : {} | ({ [containsPromises]?: true; } & {}) | null | undefined -+>awaitedValue : {} | { [containsPromises]?: true | undefined; } & {} | null | undefined ++>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) | null | undefined await fun(awaitedValue); >await fun(awaitedValue) : void >fun(awaitedValue) : Promise >fun : (deepPromised: DeepPromised) => Promise ->awaitedValue : {} | ({ [containsPromises]?: true; } & {}) -+>awaitedValue : {} | { [containsPromises]?: true | undefined; } & {} ++>awaitedValue : {} | ({ [containsPromises]?: true | undefined; } & {}) } } diff --git a/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types b/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types index 8074685c37..a929dbeb30 100644 --- a/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types +++ b/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types @@ -344,14 +344,14 @@ function f23(x: T | undefined | null) { >undefined : undefined x; // T & {} | null ->x : T & {} | null +>x : (T & {}) | null } if (x !== null) { >x !== null : boolean >x : T | null | undefined x; // T & {} | undefined ->x : T & {} | undefined +>x : (T & {}) | undefined } if (x != undefined) { >x != undefined : boolean @@ -396,7 +396,7 @@ function f31(x: T) { >"object" : "object" x; // T & object | T & null ->x : T & null | T & object +>x : (T & null) | (T & object) } if (x && typeof x === "object") { >x && typeof x === "object" : boolean @@ -410,12 +410,12 @@ function f31(x: T) { >x : T & object } if (typeof x === "object" && x) { ->typeof x === "object" && x : false | T & null | T & object +>typeof x === "object" && x : false | (T & null) | (T & object) >typeof x === "object" : boolean >typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" >x : T >"object" : "object" ->x : T & null | T & object +>x : (T & null) | (T & object) x; // T & object >x : T & object @@ -557,16 +557,16 @@ function f41(a: T) { >a : T let a3 = ensureNotNull(ensureNotNull(a)); // T & {} | T & undefined ->a3 : T & undefined | T & {} ->ensureNotNull(ensureNotNull(a)) : T & undefined | T & {} +>a3 : (T & undefined) | (T & {}) +>ensureNotNull(ensureNotNull(a)) : (T & undefined) | (T & {}) >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) >ensureNotNull(a) : T & ({} | undefined) >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) >a : T let a4 = ensureNotUndefined(ensureNotUndefined(a)); // T & {} | T & null ->a4 : T & null | T & {} ->ensureNotUndefined(ensureNotUndefined(a)) : T & null | T & {} +>a4 : (T & null) | (T & {}) +>ensureNotUndefined(ensureNotUndefined(a)) : (T & null) | (T & {}) >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) >ensureNotUndefined(a) : T & ({} | null) >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) @@ -581,32 +581,32 @@ function f41(a: T) { >a : T let a6 = ensureNotNull(possiblyNullOrUndefined(a)); // T & {} | undefined ->a6 : T & {} | undefined ->ensureNotNull(possiblyNullOrUndefined(a)) : T & {} | undefined +>a6 : (T & {}) | undefined +>ensureNotNull(possiblyNullOrUndefined(a)) : (T & {}) | undefined >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) >possiblyNullOrUndefined(a) : T | null | undefined >possiblyNullOrUndefined : (x: T_1) => T_1 | null | undefined >a : T let a7 = ensureNotUndefined(possiblyNullOrUndefined(a)); // T & {} | null ->a7 : T & {} | null ->ensureNotUndefined(possiblyNullOrUndefined(a)) : T & {} | null +>a7 : (T & {}) | null +>ensureNotUndefined(possiblyNullOrUndefined(a)) : (T & {}) | null >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) >possiblyNullOrUndefined(a) : T | null | undefined >possiblyNullOrUndefined : (x: T_1) => T_1 | null | undefined >a : T let a8 = ensureNotNull(possiblyUndefined(a)); // T & {} | undefined ->a8 : T & {} | undefined ->ensureNotNull(possiblyUndefined(a)) : T & {} | undefined +>a8 : (T & {}) | undefined +>ensureNotNull(possiblyUndefined(a)) : (T & {}) | undefined >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) >possiblyUndefined(a) : T | undefined >possiblyUndefined : (x: T_1) => T_1 | undefined >a : T let a9 = ensureNotUndefined(possiblyNull(a)); // T & {} | null ->a9 : T & {} | null ->ensureNotUndefined(possiblyNull(a)) : T & {} | null +>a9 : (T & {}) | null +>ensureNotUndefined(possiblyNull(a)) : (T & {}) | null >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) >possiblyNull(a) : T | null >possiblyNull : (x: T_1) => T_1 | null @@ -633,9 +633,9 @@ function deepEquals(a: T, b: T): boolean { >b : T >'object' : "object" >!a : boolean ->a : T & null | T & object +>a : (T & null) | (T & object) >!b : boolean ->b : T & null | T & object +>b : (T & null) | (T & object) return false; >false : false diff --git a/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types.diff b/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types.diff index 593d670144..e334c9b8af 100644 --- a/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types.diff +++ b/testdata/baselines/reference/submodule/conformance/unknownControlFlow.types.diff @@ -9,122 +9,7 @@ >x : T | null | undefined if (x !== undefined) { -@@= skipped -9, +9 lines =@@ - >undefined : undefined - - x; // T & {} | null -->x : (T & {}) | null -+>x : T & {} | null - } - if (x !== null) { - >x !== null : boolean - >x : T | null | undefined - - x; // T & {} | undefined -->x : (T & {}) | undefined -+>x : T & {} | undefined - } - if (x != undefined) { - >x != undefined : boolean -@@= skipped -52, +52 lines =@@ - >"object" : "object" - - x; // T & object | T & null -->x : (T & null) | (T & object) -+>x : T & null | T & object - } - if (x && typeof x === "object") { - >x && typeof x === "object" : boolean -@@= skipped -14, +14 lines =@@ - >x : T & object - } - if (typeof x === "object" && x) { -->typeof x === "object" && x : false | (T & null) | (T & object) -+>typeof x === "object" && x : false | T & null | T & object - >typeof x === "object" : boolean - >typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" - >x : T - >"object" : "object" -->x : (T & null) | (T & object) -+>x : T & null | T & object - - x; // T & object - >x : T & object -@@= skipped -147, +147 lines =@@ - >a : T - - let a3 = ensureNotNull(ensureNotNull(a)); // T & {} | T & undefined -->a3 : (T & undefined) | (T & {}) -->ensureNotNull(ensureNotNull(a)) : (T & undefined) | (T & {}) -+>a3 : T & undefined | T & {} -+>ensureNotNull(ensureNotNull(a)) : T & undefined | T & {} - >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) - >ensureNotNull(a) : T & ({} | undefined) - >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) - >a : T - - let a4 = ensureNotUndefined(ensureNotUndefined(a)); // T & {} | T & null -->a4 : (T & null) | (T & {}) -->ensureNotUndefined(ensureNotUndefined(a)) : (T & null) | (T & {}) -+>a4 : T & null | T & {} -+>ensureNotUndefined(ensureNotUndefined(a)) : T & null | T & {} - >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) - >ensureNotUndefined(a) : T & ({} | null) - >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) -@@= skipped -24, +24 lines =@@ - >a : T - - let a6 = ensureNotNull(possiblyNullOrUndefined(a)); // T & {} | undefined -->a6 : (T & {}) | undefined -->ensureNotNull(possiblyNullOrUndefined(a)) : (T & {}) | undefined -+>a6 : T & {} | undefined -+>ensureNotNull(possiblyNullOrUndefined(a)) : T & {} | undefined - >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) - >possiblyNullOrUndefined(a) : T | null | undefined - >possiblyNullOrUndefined : (x: T_1) => T_1 | null | undefined - >a : T - - let a7 = ensureNotUndefined(possiblyNullOrUndefined(a)); // T & {} | null -->a7 : (T & {}) | null -->ensureNotUndefined(possiblyNullOrUndefined(a)) : (T & {}) | null -+>a7 : T & {} | null -+>ensureNotUndefined(possiblyNullOrUndefined(a)) : T & {} | null - >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) - >possiblyNullOrUndefined(a) : T | null | undefined - >possiblyNullOrUndefined : (x: T_1) => T_1 | null | undefined - >a : T - - let a8 = ensureNotNull(possiblyUndefined(a)); // T & {} | undefined -->a8 : (T & {}) | undefined -->ensureNotNull(possiblyUndefined(a)) : (T & {}) | undefined -+>a8 : T & {} | undefined -+>ensureNotNull(possiblyUndefined(a)) : T & {} | undefined - >ensureNotNull : (x: T_1) => T_1 & ({} | undefined) - >possiblyUndefined(a) : T | undefined - >possiblyUndefined : (x: T_1) => T_1 | undefined - >a : T - - let a9 = ensureNotUndefined(possiblyNull(a)); // T & {} | null -->a9 : (T & {}) | null -->ensureNotUndefined(possiblyNull(a)) : (T & {}) | null -+>a9 : T & {} | null -+>ensureNotUndefined(possiblyNull(a)) : T & {} | null - >ensureNotUndefined : (x: T_1) => T_1 & ({} | null) - >possiblyNull(a) : T | null - >possiblyNull : (x: T_1) => T_1 | null -@@= skipped -52, +52 lines =@@ - >b : T - >'object' : "object" - >!a : boolean -->a : (T & null) | (T & object) -+>a : T & null | T & object - >!b : boolean -->b : (T & null) | (T & object) -+>b : T & null | T & object - - return false; - >false : false -@@= skipped -185, +185 lines =@@ +@@= skipped -483, +483 lines =@@ } function fx2(value: T & ({} | null)) {