Skip to content

Commit 4507270

Browse files
committed
Accept new baselines
1 parent 2c2d06d commit 4507270

20 files changed

+89
-81
lines changed

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/conditionalTypes1.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ type OptionsOfKind<K extends Options["k"]> = Extract<Options, { k: 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 }>;
156156
>Select : Extract<T, { [P in K]: V; }>
@@ -971,13 +971,13 @@ 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'>;
977977
>NonFooKeys2 : Exclude<keyof T, "foo">
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

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/deferredLookupTypeResolution.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ type StringContains<S extends string, L extends string> = (
1111
)[L]
1212

1313
type ObjectHasKey<O, L extends string> = StringContains<Extract<keyof O, string>, L>
14-
>ObjectHasKey : StringContains<Extract<keyof O, string>, L>
14+
>ObjectHasKey : ObjectHasKey<O, L>
1515

1616
type First<T> = ObjectHasKey<T, '0'>; // Should be deferred
17-
>First : StringContains<Extract<keyof T, string>, "0">
17+
>First : First<T>
1818

1919
type T1 = ObjectHasKey<{ a: string }, 'a'>; // 'true'
2020
>T1 : "true"

tests/baselines/reference/deferredLookupTypeResolution2.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ type StringContains<S extends string, L extends string> = ({ [K in S]: 'true' }
66
>key : string
77

88
type ObjectHasKey<O, L extends string> = StringContains<Extract<keyof O, string>, L>;
9-
>ObjectHasKey : StringContains<Extract<keyof O, string>, L>
9+
>ObjectHasKey : ObjectHasKey<O, L>
1010

1111
type A<T> = ObjectHasKey<T, '0'>;
12-
>A : StringContains<Extract<keyof T, string>, "0">
12+
>A : A<T>
1313

1414
type B = ObjectHasKey<[string, number], '1'>; // "true"
1515
>B : "true"

tests/baselines/reference/indexingTypesWithNever.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ type P0 = {};
145145
>P0 : P0
146146

147147
type P3Names = RequiredPropNames<P3>; // expect 'a' | 'b'
148-
>P3Names : RequiredPropNames<P3>
148+
>P3Names : P3Names
149149

150150
type P2Names = RequiredPropNames<P2>; // expect 'a'
151151
>P2Names : "a"
@@ -214,7 +214,7 @@ type O0 = {};
214214
>O0 : O0
215215

216216
type O3Names = OptionalPropNames<O3>; // expect 'a' | 'b'
217-
>O3Names : OptionalPropNames<O3>
217+
>O3Names : O3Names
218218

219219
type O2Names = OptionalPropNames<O2>; // expect 'a'
220220
>O2Names : "a"

tests/baselines/reference/intersectionTypeInference3.types

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,37 @@ type Nominal<Kind extends string, Type> = Type & {
1313
};
1414

1515
type A = Nominal<'A', string>;
16-
>A : Nominal<"A", string>
16+
>A : A
1717

1818
declare const a: Set<A>;
19-
>a : Set<Nominal<"A", string>>
19+
>a : Set<A>
2020

2121
declare const b: Set<A>;
22-
>b : Set<Nominal<"A", string>>
22+
>b : Set<A>
2323

2424
const c1 = Array.from(a).concat(Array.from(b));
25-
>c1 : Nominal<"A", string>[]
26-
>Array.from(a).concat(Array.from(b)) : Nominal<"A", string>[]
27-
>Array.from(a).concat : { (...items: ConcatArray<Nominal<"A", string>>[]): Nominal<"A", string>[]; (...items: (Nominal<"A", string> | ConcatArray<Nominal<"A", string>>)[]): Nominal<"A", string>[]; }
28-
>Array.from(a) : Nominal<"A", string>[]
25+
>c1 : A[]
26+
>Array.from(a).concat(Array.from(b)) : A[]
27+
>Array.from(a).concat : { (...items: ConcatArray<A>[]): A[]; (...items: (A | ConcatArray<A>)[]): A[]; }
28+
>Array.from(a) : A[]
2929
>Array.from : { <T>(arrayLike: ArrayLike<T>): T[]; <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; <T>(iterable: Iterable<T> | ArrayLike<T>): T[]; <T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }
3030
>Array : ArrayConstructor
3131
>from : { <T>(arrayLike: ArrayLike<T>): T[]; <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; <T>(iterable: Iterable<T> | ArrayLike<T>): T[]; <T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }
32-
>a : Set<Nominal<"A", string>>
33-
>concat : { (...items: ConcatArray<Nominal<"A", string>>[]): Nominal<"A", string>[]; (...items: (Nominal<"A", string> | ConcatArray<Nominal<"A", string>>)[]): Nominal<"A", string>[]; }
34-
>Array.from(b) : Nominal<"A", string>[]
32+
>a : Set<A>
33+
>concat : { (...items: ConcatArray<A>[]): A[]; (...items: (A | ConcatArray<A>)[]): A[]; }
34+
>Array.from(b) : A[]
3535
>Array.from : { <T>(arrayLike: ArrayLike<T>): T[]; <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; <T>(iterable: Iterable<T> | ArrayLike<T>): T[]; <T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }
3636
>Array : ArrayConstructor
3737
>from : { <T>(arrayLike: ArrayLike<T>): T[]; <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; <T>(iterable: Iterable<T> | ArrayLike<T>): T[]; <T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }
38-
>b : Set<Nominal<"A", string>>
38+
>b : Set<A>
3939

4040
// Simpler repro
4141

4242
declare function from<T>(): T[];
4343
>from : <T>() => T[]
4444

4545
const c2: ReadonlyArray<A> = from();
46-
>c2 : readonly Nominal<"A", string>[]
47-
>from() : Nominal<"A", string>[]
46+
>c2 : readonly A[]
47+
>from() : A[]
4848
>from : <T>() => T[]
4949

tests/baselines/reference/intersectionWithIndexSignatures.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts(17
22
Property 'y' is incompatible with index signature.
33
Property 'a' is missing in type 'B' but required in type 'A'.
44
tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts(27,10): error TS2339: Property 'b' does not exist on type '{ a: string; }'.
5-
tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts(29,7): error TS2322: Type 'constr<{}, { [key: string]: { a: string; }; }>' is not assignable to type '{ [key: string]: { a: string; b: string; }; }'.
5+
tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts(29,7): error TS2322: Type 's' is not assignable to type '{ [key: string]: { a: string; b: string; }; }'.
66
Index signatures are incompatible.
77
Property 'b' is missing in type '{ a: string; }' but required in type '{ a: string; b: string; }'.
88
tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts(35,1): error TS2322: Type '{ a: string; } & { b: number; }' is not assignable to type '{ [key: string]: string; }'.
@@ -48,7 +48,7 @@ tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts(35
4848

4949
const d: { [key: string]: {a: string, b: string} } = q; // Error
5050
~
51-
!!! error TS2322: Type 'constr<{}, { [key: string]: { a: string; }; }>' is not assignable to type '{ [key: string]: { a: string; b: string; }; }'.
51+
!!! error TS2322: Type 's' is not assignable to type '{ [key: string]: { a: string; b: string; }; }'.
5252
!!! error TS2322: Index signatures are incompatible.
5353
!!! error TS2322: Property 'b' is missing in type '{ a: string; }' but required in type '{ a: string; b: string; }'.
5454
!!! related TS2728 tests/cases/conformance/types/intersection/intersectionWithIndexSignatures.ts:29:39: 'b' is declared here.

tests/baselines/reference/intersectionWithIndexSignatures.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ type constr<Source, Tgt> = { [K in keyof Source]: string } & Pick<Tgt, Exclude<k
6565
>constr : constr<Source, Tgt>
6666

6767
type s = constr<{}, { [key: string]: { a: string } }>;
68-
>s : constr<{}, { [key: string]: { a: string; }; }>
68+
>s : s
6969
>key : string
7070
>a : string
7171

7272
declare const q: s;
73-
>q : constr<{}, { [key: string]: { a: string; }; }>
73+
>q : s
7474

7575
q["asd"].a.substr(1);
7676
>q["asd"].a.substr(1) : string
7777
>q["asd"].a.substr : (from: number, length?: number | undefined) => string
7878
>q["asd"].a : string
7979
>q["asd"] : { a: string; }
80-
>q : constr<{}, { [key: string]: { a: string; }; }>
80+
>q : s
8181
>"asd" : "asd"
8282
>a : string
8383
>substr : (from: number, length?: number | undefined) => string
@@ -86,7 +86,7 @@ q["asd"].a.substr(1);
8686
q["asd"].b; // Error
8787
>q["asd"].b : any
8888
>q["asd"] : { a: string; }
89-
>q : constr<{}, { [key: string]: { a: string; }; }>
89+
>q : s
9090
>"asd" : "asd"
9191
>b : any
9292

@@ -95,7 +95,7 @@ const d: { [key: string]: {a: string, b: string} } = q; // Error
9595
>key : string
9696
>a : string
9797
>b : string
98-
>q : constr<{}, { [key: string]: { a: string; }; }>
98+
>q : s
9999

100100
// Repro from #32484
101101

tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type ExtractValueType<T> = T extends ReactSelectProps<infer U> ? U : never;
1818
>ExtractValueType : ExtractValueType<T>
1919

2020
export type ReactSingleSelectProps<
21-
>ReactSingleSelectProps : Overwrite<Omit<WrappedProps, "multi">, Props<ExtractValueType<WrappedProps>>>
21+
>ReactSingleSelectProps : ReactSingleSelectProps<WrappedProps>
2222

2323
WrappedProps extends ReactSelectProps<any>
2424
> = Overwrite<
@@ -118,11 +118,11 @@ declare class ReactSelectClass<TValue = OptionValues> extends React.Component<Re
118118
}
119119

120120
export type OptionComponentType<TValue = OptionValues> = React.ComponentType<OptionComponentProps<TValue>>;
121-
>OptionComponentType : React.ComponentType<OptionComponentProps<TValue>>
121+
>OptionComponentType : OptionComponentType<TValue>
122122
>React : any
123123

124124
export type ValueComponentType<TValue = OptionValues> = React.ComponentType<ValueComponentProps<TValue>>;
125-
>ValueComponentType : React.ComponentType<ValueComponentProps<TValue>>
125+
>ValueComponentType : ValueComponentType<TValue>
126126
>React : any
127127

128128
export type HandlerRendererResult = JSX.Element | null | false;
@@ -859,7 +859,7 @@ export interface ReactSelectProps<TValue = OptionValues> extends React.Props<Rea
859859
* option component to render in dropdown
860860
*/
861861
optionComponent?: OptionComponentType<TValue>;
862-
>optionComponent : React.ComponentType<OptionComponentProps<TValue>> | undefined
862+
>optionComponent : OptionComponentType<TValue> | undefined
863863

864864
/**
865865
* function which returns a custom way to render the options in the menu
@@ -973,7 +973,7 @@ export interface ReactSelectProps<TValue = OptionValues> extends React.Props<Rea
973973
* value component to render
974974
*/
975975
valueComponent?: ValueComponentType<TValue>;
976-
>valueComponent : React.ComponentType<ValueComponentProps<TValue>> | undefined
976+
>valueComponent : ValueComponentType<TValue> | undefined
977977

978978
/**
979979
* optional style to apply to the component wrapper

tests/baselines/reference/keyofDoesntContainSymbols.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ type Values<T> = T[keyof T];
8585
>Values : Values<T>
8686

8787
type ValuesOfObj = Values<typeof obj>;
88-
>ValuesOfObj : Values<{ num: number; str: string; 0: 0; [sym]: symbol; }>
88+
>ValuesOfObj : ValuesOfObj
8989
>obj : { num: number; str: string; 0: 0; [sym]: symbol; }
9090

tests/baselines/reference/keyofIntersection.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ type T04<T, U> = keyof (T & U); // keyof T | keyof U
2020
>T04 : keyof T | keyof U
2121

2222
type T05 = T02<A>; // "a" | "b"
23-
>T05 : "b" | "a"
23+
>T05 : T05
2424

2525
type T06 = T03<B>; // "a" | "b"
26-
>T06 : "b" | "a"
26+
>T06 : T06
2727

2828
type T07 = T04<A, B>; // "a" | "b"
29-
>T07 : "b" | "a"
29+
>T07 : T07
3030

3131
// Repros from #22291
3232

3333
type Example1<T extends string, U extends string> = keyof (Record<T, any> & Record<U, any>);
3434
>Example1 : T | U
3535

3636
type Result1 = Example1<'x', 'y'>; // "x" | "y"
37-
>Result1 : "x" | "y"
37+
>Result1 : Result1
3838

3939
type Result2 = keyof (Record<'x', any> & Record<'y', any>); // "x" | "y"
4040
>Result2 : "x" | "y"
@@ -55,5 +55,5 @@ type Example5<T, U> = keyof (T & U);
5555
>Example5 : keyof T | keyof U
5656

5757
type Result5 = Example5<Record<'x', any>, Record<'y', any>>; // "x" | "y"
58-
>Result5 : "x" | "y"
58+
>Result5 : Result5
5959

tests/baselines/reference/propTypeValidatorInference.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ const propTypesWithoutAnnotation = {
275275
};
276276

277277
type ExtractedProps = PropTypes.InferProps<typeof propTypes>;
278-
>ExtractedProps : PropTypes.InferProps<PropTypes.ValidationMap<Props>>
278+
>ExtractedProps : ExtractedProps
279279
>PropTypes : any
280280
>propTypes : PropTypes.ValidationMap<Props>
281281

282282
type ExtractedPropsWithoutAnnotation = PropTypes.InferProps<typeof propTypesWithoutAnnotation>;
283-
>ExtractedPropsWithoutAnnotation : PropTypes.InferProps<{ any: PropTypes.Requireable<any>; array: PropTypes.Validator<any[]>; bool: PropTypes.Validator<boolean>; shape: PropTypes.Validator<PropTypes.InferProps<{ foo: PropTypes.Validator<string>; bar: PropTypes.Requireable<boolean>; baz: PropTypes.Requireable<any>; }>>; oneOfType: PropTypes.Validator<string | boolean | PropTypes.InferProps<{ foo: PropTypes.Requireable<string>; bar: PropTypes.Validator<number>; }>>; }>
283+
>ExtractedPropsWithoutAnnotation : ExtractedPropsWithoutAnnotation
284284
>PropTypes : any
285285
>propTypesWithoutAnnotation : { any: PropTypes.Requireable<any>; array: PropTypes.Validator<any[]>; bool: PropTypes.Validator<boolean>; shape: PropTypes.Validator<PropTypes.InferProps<{ foo: PropTypes.Validator<string>; bar: PropTypes.Requireable<boolean>; baz: PropTypes.Requireable<any>; }>>; oneOfType: PropTypes.Validator<string | boolean | PropTypes.InferProps<{ foo: PropTypes.Requireable<string>; bar: PropTypes.Validator<number>; }>>; }
286286

tests/baselines/reference/ramdaToolsNoInfinite.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ declare namespace Tools {
8383
>Cast : Cast<X, Y>
8484

8585
type Pos<I extends any[]> =
86-
>Pos : Length<I>
86+
>Pos : Pos<I>
8787

8888
Length<I>;
8989

@@ -116,7 +116,7 @@ declare namespace Tools {
116116
>Reverse : Reverse<T, R, I>
117117

118118
0: Reverse<T, Prepend<T[Pos<I>], R>, Next<I>>;
119-
>0 : Reverse<T, [head: T[Length<I>], ...args: R], [head: any, ...args: I]>
119+
>0 : Reverse<T, [head: T[Pos<I>], ...args: R], [head: any, ...args: I]>
120120

121121
1: R;
122122
>1 : R
@@ -128,12 +128,12 @@ declare namespace Tools {
128128
];
129129

130130
type Concat<T1 extends any[], T2 extends any[]> =
131-
>Concat : Reverse<Reverse<T1, [], []> extends infer R ? Cast<R, any[]> : never, T2, []>
131+
>Concat : Concat<T1, T2>
132132

133133
Reverse<Reverse<T1> extends infer R ? Cast<R, any[]> : never, T2>;
134134

135135
type Append<E, T extends any[]> =
136-
>Append : Reverse<Reverse<T, [], []> extends infer R ? Cast<R, any[]> : never, [E], []>
136+
>Append : Append<E, T>
137137

138138
Concat<T, [E]>;
139139

@@ -168,7 +168,7 @@ declare namespace Curry {
168168
>Tools : any
169169

170170
1: Tools.Concat<TN, Tools.Drop<Tools.Pos<I>, T2> extends infer D ? Tools.Cast<D, any[]> : never>;
171-
>1 : Tools.Reverse<Tools.Reverse<TN, [], []> extends infer R ? Tools.Cast<R, any[]> : never, Tools.Drop<Tools.Length<I>, T2, []> extends infer D ? Tools.Cast<D, any[]> : never, []>
171+
>1 : Tools.Concat<TN, Tools.Drop<Tools.Pos<I>, T2, []> extends infer D ? Tools.Cast<D, any[]> : never>
172172
>Tools : any
173173
>Tools : any
174174
>Tools : any

0 commit comments

Comments
 (0)