Skip to content

Commit 54da2a4

Browse files
committed
Accept new baselines
1 parent 0c6dfb7 commit 54da2a4

File tree

74 files changed

+284
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+284
-273
lines changed

tests/baselines/reference/aliasOfGenericFunctionWithRestBehavedSameAsUnaliased.types

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ type ExtendedMapper<HandledInputT, OutputT, ArgsT extends any[]> = (name : strin
88
>args : ArgsT
99

1010
type a = ExtendedMapper<any, any, [any]>;
11-
>a : ExtendedMapper<any, any, [any]>
11+
>a : a
1212

1313
type b = ExtendedMapper<any, any, any[]>;
14-
>b : ExtendedMapper<any, any, any[]>
14+
>b : b
1515

1616
type test = a extends b ? "y" : "n"
1717
>test : "y"
@@ -32,10 +32,10 @@ type ExtendedMapper1<HandledInputT, OutputT, ArgsT extends any[]> = (
3232
);
3333

3434
type a1 = ExtendedMapper1<any, any, [any]>;
35-
>a1 : ExtendedMapper1<any, any, [any]>
35+
>a1 : a1
3636

3737
type b1 = ExtendedMapper1<any, any, any[]>;
38-
>b1 : ExtendedMapper1<any, any, any[]>
38+
>b1 : b1
3939

4040
type test1 = a1 extends b1 ? "y" : "n"
4141
>test1 : "y"
@@ -56,10 +56,10 @@ type ExtendedMapper2<HandledInputT, OutputT, ArgsT extends any[]> = (
5656
);
5757

5858
type a2 = ExtendedMapper2<any, any, [any]>;
59-
>a2 : (name: string, mixed: any, args_0: any) => any
59+
>a2 : a2
6060

6161
type b2 = ExtendedMapper2<any, any, any[]>;
62-
>b2 : (name: string, mixed: any, ...args: any[]) => any
62+
>b2 : b2
6363

6464
type test2 = a2 extends b2 ? "y" : "n"
6565
>test2 : "y"

tests/baselines/reference/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export declare type TypeB = Merge<TypeA, {
6060
b: string;
6161
}>;
6262
//// [index.d.ts]
63+
import { TypeB } from './type-b';
6364
export declare class Broken {
64-
method(): import("./types").Merge<import("./type-a").TypeA, {
65-
b: string;
66-
}>;
65+
method(): TypeB;
6766
}

tests/baselines/reference/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export class Broken {
66
>Broken : Broken
77

88
method () {
9-
>method : () => import("tests/cases/compiler/Uppercased_Dir/src/types").Merge<import("tests/cases/compiler/Uppercased_Dir/src/type-a").TypeA, { b: string; }>
9+
>method : () => TypeB
1010

1111
return { } as TypeB;
12-
>{ } as TypeB : import("tests/cases/compiler/Uppercased_Dir/src/types").Merge<import("tests/cases/compiler/Uppercased_Dir/src/type-a").TypeA, { b: string; }>
12+
>{ } as TypeB : TypeB
1313
>{ } : {}
1414
}
1515
}
@@ -21,7 +21,7 @@ import { TypeA } from './type-a';
2121
>TypeA : any
2222

2323
export type TypeB = Merge<TypeA, {
24-
>TypeB : Merge<TypeA, { b: string; }>
24+
>TypeB : TypeB
2525

2626
b: string;
2727
>b : string

tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export type Matching<InjectedProps, DecorationTargetProps> = {
113113
};
114114

115115
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
116-
>Omit : Pick<T, Exclude<keyof T, K>>
116+
>Omit : Omit<T, K>
117117

118118
export type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> =
119119
>InferableComponentEnhancerWithProps : InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps>

tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== tests/cases/compiler/circularlySimplifyingConditionalTypesNoCrash.ts ===
22
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
3-
>Omit : Pick<T, Exclude<keyof T, K>>
3+
>Omit : Omit<T, K>
44

55
type Shared< // Circularly self constraining type, defered thanks to mapping
66
>Shared : Shared<InjectedProps, DecorationTargetProps>

tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type ChannelType = Channel extends { type: infer R } ? R : never;
2929
>type : R
3030

3131
type Omit<T, K extends keyof T> = Pick<
32-
>Omit : Pick<T, ({ [P in keyof T]: P; } & { [P in K]: never; } & { [x: string]: never; })[keyof T]>
32+
>Omit : Omit<T, K>
3333

3434
T,
3535
({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T]

tests/baselines/reference/conditionalTypeDiscriminatingLargeUnionRegularTypeFetchingSpeedReasonable.types

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

tests/baselines/reference/conditionalTypes1.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(159,5): error TS2
5252
tests/cases/conformance/types/conditional/conditionalTypes1.ts(160,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf<T>'.
5353
Type 'string | number' is not assignable to type 'ZeroOf<T>'.
5454
Type 'string' is not assignable to type 'ZeroOf<T>'.
55-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(263,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo<T & U>'.
55+
tests/cases/conformance/types/conditional/conditionalTypes1.ts(263,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'T2'.
5656
tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS2322: Type 'T95<U>' is not assignable to type 'T94<U>'.
5757
Type 'number | boolean' is not assignable to type 'T94<U>'.
5858
Type 'number' is not assignable to type 'T94<U>'.
@@ -398,7 +398,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
398398
var z: T1;
399399
var z: T2; // Error, T2 is distributive, T1 isn't
400400
~
401-
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo<T & U>'.
401+
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'T2'.
402402
!!! related TS6203 tests/cases/conformance/types/conditional/conditionalTypes1.ts:262:9: 'z' was also declared here.
403403
}
404404

tests/baselines/reference/conditionalTypes1.types

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
=== tests/cases/conformance/types/conditional/conditionalTypes1.ts ===
22
type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d"
3-
>T00 : "b" | "d"
3+
>T00 : T00
44

55
type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c"
6-
>T01 : "a" | "c"
6+
>T01 : T01
77

88
type T02 = Exclude<string | number | (() => void), Function>; // string | number
9-
>T02 : string | number
9+
>T02 : T02
1010

1111
type T03 = Extract<string | number | (() => void), Function>; // () => void
1212
>T03 : () => void
1313

1414
type T04 = NonNullable<string | number | undefined>; // string | number
15-
>T04 : string | number
15+
>T04 : T04
1616

1717
type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[]
18-
>T05 : (() => string) | string[]
18+
>T05 : T05
1919
>null : null
2020

2121
function f1<T>(x: T, y: NonNullable<T>) {
@@ -113,7 +113,7 @@ type T10 = Exclude<Options, { k: "a" | "b" }>; // { k: "c", c: boolean }
113113
>k : "a" | "b"
114114

115115
type T11 = Extract<Options, { k: "a" | "b" }>; // { k: "a", a: number } | { k: "b", b: string }
116-
>T11 : { k: "a"; a: number; } | { k: "b"; b: string; }
116+
>T11 : T11
117117
>k : "a" | "b"
118118

119119
type T12 = Exclude<Options, { k: "a" } | { k: "b" }>; // { k: "c", c: boolean }
@@ -122,12 +122,12 @@ type T12 = Exclude<Options, { k: "a" } | { k: "b" }>; // { k: "c", c: boolean }
122122
>k : "b"
123123

124124
type T13 = Extract<Options, { k: "a" } | { k: "b" }>; // { k: "a", a: number } | { k: "b", b: string }
125-
>T13 : { k: "a"; a: number; } | { k: "b"; b: string; }
125+
>T13 : T13
126126
>k : "a"
127127
>k : "b"
128128

129129
type T14 = Exclude<Options, { q: "a" }>; // Options
130-
>T14 : Options
130+
>T14 : T14
131131
>q : "a"
132132

133133
type T15 = Extract<Options, { q: "a" }>; // never
@@ -146,17 +146,17 @@ let x0 = f5("a"); // { k: "a", a: number }
146146
>"a" : "a"
147147

148148
type OptionsOfKind<K extends Options["k"]> = Extract<Options, { k: K }>;
149-
>OptionsOfKind : Extract<{ k: "a"; a: number; }, { k: K; }> | Extract<{ k: "b"; b: string; }, { k: K; }> | Extract<{ k: "c"; c: boolean; }, { k: K; }>
149+
>OptionsOfKind : OptionsOfKind<K>
150150
>k : K
151151

152152
type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string }
153-
>T16 : { k: "a"; a: number; } | { k: "b"; b: string; }
153+
>T16 : T16
154154

155155
type Select<T, K extends keyof T, V extends T[K]> = Extract<T, { [P in K]: V }>;
156-
>Select : Extract<T, { [P in K]: V; }>
156+
>Select : Select<T, K, V>
157157

158158
type T17 = Select<Options, "k", "a" | "b">; // // { k: "a", a: number } | { k: "b", b: string }
159-
>T17 : { k: "a"; a: number; } | { k: "b"; b: string; }
159+
>T17 : T17
160160

161161
type TypeName<T> =
162162
>TypeName : TypeName<T>
@@ -169,7 +169,7 @@ type TypeName<T> =
169169
"object";
170170

171171
type T20 = TypeName<string | (() => void)>; // "string" | "function"
172-
>T20 : "string" | "function"
172+
>T20 : T20
173173

174174
type T21 = TypeName<any>; // "string" | "number" | "boolean" | "undefined" | "function" | "object"
175175
>T21 : "string" | "number" | "boolean" | "undefined" | "object" | "function"
@@ -230,19 +230,19 @@ type FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? K : ne
230230
>FunctionPropertyNames : FunctionPropertyNames<T>
231231

232232
type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>;
233-
>FunctionProperties : Pick<T, FunctionPropertyNames<T>>
233+
>FunctionProperties : FunctionProperties<T>
234234

235235
type NonFunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T];
236236
>NonFunctionPropertyNames : NonFunctionPropertyNames<T>
237237

238238
type NonFunctionProperties<T> = Pick<T, NonFunctionPropertyNames<T>>;
239-
>NonFunctionProperties : Pick<T, NonFunctionPropertyNames<T>>
239+
>NonFunctionProperties : NonFunctionProperties<T>
240240

241241
type T30 = FunctionProperties<Part>;
242-
>T30 : Pick<Part, "updatePart">
242+
>T30 : T30
243243

244244
type T31 = NonFunctionProperties<Part>;
245-
>T31 : Pick<Part, NonFunctionPropertyNames<Part>>
245+
>T31 : T31
246246

247247
function f7<T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) {
248248
>f7 : <T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) => void
@@ -523,20 +523,20 @@ type If<C extends boolean, T, F> = C extends true ? T : F;
523523
>true : true
524524

525525
type Not<C extends boolean> = If<C, false, true>;
526-
>Not : If<C, false, true>
526+
>Not : Not<C>
527527
>false : false
528528
>true : true
529529

530530
type And<A extends boolean, B extends boolean> = If<A, B, false>;
531-
>And : If<A, B, false>
531+
>And : And<A, B>
532532
>false : false
533533

534534
type Or<A extends boolean, B extends boolean> = If<A, true, B>;
535-
>Or : If<A, true, B>
535+
>Or : Or<A, B>
536536
>true : true
537537

538538
type IsString<T> = Extends<T, string>;
539-
>IsString : Extends<T, string>
539+
>IsString : IsString<T>
540540

541541
type Q1 = IsString<number>; // false
542542
>Q1 : false
@@ -559,7 +559,7 @@ type N2 = Not<true>; // false
559559
>true : true
560560

561561
type N3 = Not<boolean>; // boolean
562-
>N3 : boolean
562+
>N3 : N3
563563

564564
type A1 = And<false, false>; // false
565565
>A1 : false
@@ -590,15 +590,15 @@ type A6 = And<false, boolean>; // false
590590
>false : false
591591

592592
type A7 = And<boolean, true>; // boolean
593-
>A7 : boolean
593+
>A7 : A7
594594
>true : true
595595

596596
type A8 = And<true, boolean>; // boolean
597597
>A8 : boolean
598598
>true : true
599599

600600
type A9 = And<boolean, boolean>; // boolean
601-
>A9 : boolean
601+
>A9 : A9
602602

603603
type O1 = Or<false, false>; // false
604604
>O1 : false
@@ -621,7 +621,7 @@ type O4 = Or<true, true>; // true
621621
>true : true
622622

623623
type O5 = Or<boolean, false>; // boolean
624-
>O5 : boolean
624+
>O5 : O5
625625
>false : false
626626

627627
type O6 = Or<false, boolean>; // boolean
@@ -637,7 +637,7 @@ type O8 = Or<true, boolean>; // true
637637
>true : true
638638

639639
type O9 = Or<boolean, boolean>; // boolean
640-
>O9 : boolean
640+
>O9 : O9
641641

642642
type T40 = never extends never ? true : false; // true
643643
>T40 : true
@@ -785,7 +785,7 @@ const convert = <U>(value: Foo<U>): Bar<U> => value;
785785
>value : Foo<U>
786786

787787
type Baz<T> = Foo<T>;
788-
>Baz : Foo<T>
788+
>Baz : Baz<T>
789789

790790
const convert2 = <T>(value: Foo<T>): Baz<T> => value;
791791
>convert2 : <T>(value: Foo<T>) => Foo<T>
@@ -816,7 +816,7 @@ function f32<T, U>() {
816816
>T1 : T & U extends string ? boolean : number
817817

818818
type T2 = Foo<T & U>;
819-
>T2 : Foo<T & U>
819+
>T2 : T & U extends string ? boolean : number
820820

821821
var z: T1;
822822
>z : T & U extends string ? boolean : number
@@ -829,16 +829,16 @@ function f33<T, U>() {
829829
>f33 : <T, U>() => void
830830

831831
type T1 = Foo<T & U>;
832-
>T1 : Foo<T & U>
832+
>T1 : T & U extends string ? boolean : number
833833

834834
type T2 = Bar<T & U>;
835-
>T2 : Bar<T & U>
835+
>T2 : T & U extends string ? boolean : number
836836

837837
var z: T1;
838-
>z : Foo<T & U>
838+
>z : T & U extends string ? boolean : number
839839

840840
var z: T2;
841-
>z : Foo<T & U>
841+
>z : T & U extends string ? boolean : number
842842
}
843843

844844
// Repro from #21823
@@ -971,19 +971,19 @@ type c2 = B2['c']; // 'c' | 'b'
971971
// Repro from #21929
972972

973973
type NonFooKeys1<T extends object> = OldDiff<keyof T, 'foo'>;
974-
>NonFooKeys1 : OldDiff<keyof T, "foo">
974+
>NonFooKeys1 : NonFooKeys1<T>
975975

976976
type NonFooKeys2<T extends object> = Exclude<keyof T, 'foo'>;
977-
>NonFooKeys2 : Exclude<keyof T, "foo">
977+
>NonFooKeys2 : NonFooKeys2<T>
978978

979979
type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz"
980-
>Test1 : OldDiff<"foo" | "bar" | "baz", "foo">
980+
>Test1 : Test1
981981
>foo : 1
982982
>bar : 2
983983
>baz : 3
984984

985985
type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz"
986-
>Test2 : "bar" | "baz"
986+
>Test2 : Test2
987987
>foo : 1
988988
>bar : 2
989989
>baz : 3

tests/baselines/reference/conditionalTypes2.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ declare type GetPropertyNamesOfType<T, RestrictToType> = {
500500
}[Extract<keyof T, string>];
501501

502502
declare type GetAllPropertiesOfType<T, RestrictToType> = Pick<
503-
>GetAllPropertiesOfType : Pick<T, GetPropertyNamesOfType<Required<T>, RestrictToType>>
503+
>GetAllPropertiesOfType : GetAllPropertiesOfType<T, RestrictToType>
504504

505505
T,
506506
GetPropertyNamesOfType<Required<T>, RestrictToType>

tests/baselines/reference/declarationEmitBundleWithAmbientReferences.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Result } from "lib/result";
1414
>Result : any
1515

1616
export type T<T> = Result<Error, T>;
17-
>T : Result<Error, T>
17+
>T : import("tests/cases/compiler/src/datastore_result").T<T>
1818

1919
=== tests/cases/compiler/src/conditional_directive_field.ts ===
2020
import * as DatastoreResult from "src/datastore_result";

tests/baselines/reference/declarationEmitMappedPrivateTypeTypeParameter.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== /Helpers.ts ===
22
export type StringKeyOf<TObj> = Extract<string, keyof TObj>;
3-
>StringKeyOf : Extract<string, keyof TObj>
3+
>StringKeyOf : StringKeyOf<TObj>
44

55
=== /FromFactor.ts ===
66
export type RowToColumns<TColumns> = {

tests/baselines/reference/declarationEmitQualifiedAliasTypeArgument.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ exports.fun2 = bbb_1.create();
3737

3838

3939
//// [index.d.ts]
40-
export declare const fun: () => import("./bbb").INode<import("./lib").G<import("./lib").E>>;
41-
export declare const fun2: () => import("./bbb").INode<import("./lib").G<import("./lib").E.A>>;
40+
import { T, Q } from "./lib";
41+
export declare const fun: () => import("./bbb").INode<T>;
42+
export declare const fun2: () => import("./bbb").INode<Q>;

0 commit comments

Comments
 (0)