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

0 commit comments

Comments
 (0)