Skip to content

Commit 8ac7030

Browse files
committed
Accept new baselines
1 parent 1b0d12e commit 8ac7030

26 files changed

+143
-123
lines changed

tests/baselines/reference/conditionalTypes1.errors.txt

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,24 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(29,5): error TS23
1313
tests/cases/conformance/types/conditional/conditionalTypes1.ts(30,9): error TS2322: Type 'T["x"]' is not assignable to type 'string'.
1414
Type 'string | undefined' is not assignable to type 'string'.
1515
Type 'undefined' is not assignable to type 'string'.
16-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2322: Type 'Pick<T, FunctionPropertyNames<T>>' is not assignable to type 'T'.
17-
'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, FunctionPropertyNames<T>>'.
18-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(104,5): error TS2322: Type 'Pick<T, NonFunctionPropertyNames<T>>' is not assignable to type 'T'.
19-
'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, NonFunctionPropertyNames<T>>'.
20-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(106,5): error TS2322: Type 'Pick<T, NonFunctionPropertyNames<T>>' is not assignable to type 'Pick<T, FunctionPropertyNames<T>>'.
16+
tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2322: Type 'FunctionProperties<T>' is not assignable to type 'T'.
17+
'T' could be instantiated with an arbitrary type which could be unrelated to 'FunctionProperties<T>'.
18+
tests/cases/conformance/types/conditional/conditionalTypes1.ts(104,5): error TS2322: Type 'NonFunctionProperties<T>' is not assignable to type 'T'.
19+
'T' could be instantiated with an arbitrary type which could be unrelated to 'NonFunctionProperties<T>'.
20+
tests/cases/conformance/types/conditional/conditionalTypes1.ts(106,5): error TS2322: Type 'NonFunctionProperties<T>' is not assignable to type 'FunctionProperties<T>'.
2121
Type 'FunctionPropertyNames<T>' is not assignable to type 'NonFunctionPropertyNames<T>'.
22-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(108,5): error TS2322: Type 'Pick<T, FunctionPropertyNames<T>>' is not assignable to type 'Pick<T, NonFunctionPropertyNames<T>>'.
22+
Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
23+
Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
24+
Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
25+
Type 'keyof T' is not assignable to type 'never'.
26+
Type 'string | number | symbol' is not assignable to type 'never'.
27+
Type 'string' is not assignable to type 'never'.
28+
tests/cases/conformance/types/conditional/conditionalTypes1.ts(108,5): error TS2322: Type 'FunctionProperties<T>' is not assignable to type 'NonFunctionProperties<T>'.
2329
Type 'NonFunctionPropertyNames<T>' is not assignable to type 'FunctionPropertyNames<T>'.
30+
Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
31+
Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
32+
Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
33+
Type 'keyof T' is not assignable to type 'never'.
2434
tests/cases/conformance/types/conditional/conditionalTypes1.ts(114,5): error TS2322: Type 'keyof T' is not assignable to type 'FunctionPropertyNames<T>'.
2535
Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
2636
Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
@@ -185,22 +195,32 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
185195
function f7<T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) {
186196
x = y; // Error
187197
~
188-
!!! error TS2322: Type 'Pick<T, FunctionPropertyNames<T>>' is not assignable to type 'T'.
189-
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, FunctionPropertyNames<T>>'.
198+
!!! error TS2322: Type 'FunctionProperties<T>' is not assignable to type 'T'.
199+
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'FunctionProperties<T>'.
190200
x = z; // Error
191201
~
192-
!!! error TS2322: Type 'Pick<T, NonFunctionPropertyNames<T>>' is not assignable to type 'T'.
193-
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, NonFunctionPropertyNames<T>>'.
202+
!!! error TS2322: Type 'NonFunctionProperties<T>' is not assignable to type 'T'.
203+
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'NonFunctionProperties<T>'.
194204
y = x;
195205
y = z; // Error
196206
~
197-
!!! error TS2322: Type 'Pick<T, NonFunctionPropertyNames<T>>' is not assignable to type 'Pick<T, FunctionPropertyNames<T>>'.
207+
!!! error TS2322: Type 'NonFunctionProperties<T>' is not assignable to type 'FunctionProperties<T>'.
198208
!!! error TS2322: Type 'FunctionPropertyNames<T>' is not assignable to type 'NonFunctionPropertyNames<T>'.
209+
!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
210+
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
211+
!!! error TS2322: Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
212+
!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
213+
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'never'.
214+
!!! error TS2322: Type 'string' is not assignable to type 'never'.
199215
z = x;
200216
z = y; // Error
201217
~
202-
!!! error TS2322: Type 'Pick<T, FunctionPropertyNames<T>>' is not assignable to type 'Pick<T, NonFunctionPropertyNames<T>>'.
218+
!!! error TS2322: Type 'FunctionProperties<T>' is not assignable to type 'NonFunctionProperties<T>'.
203219
!!! error TS2322: Type 'NonFunctionPropertyNames<T>' is not assignable to type 'FunctionPropertyNames<T>'.
220+
!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
221+
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
222+
!!! error TS2322: Type 'string' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'.
223+
!!! error TS2322: Type 'keyof T' is not assignable to type 'never'.
204224
}
205225

206226
function f8<T>(x: keyof T, y: FunctionPropertyNames<T>, z: NonFunctionPropertyNames<T>) {

tests/baselines/reference/conditionalTypes1.types

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -247,38 +247,38 @@ type T31 = NonFunctionProperties<Part>;
247247
function f7<T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) {
248248
>f7 : <T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) => void
249249
>x : T
250-
>y : Pick<T, FunctionPropertyNames<T>>
251-
>z : Pick<T, NonFunctionPropertyNames<T>>
250+
>y : FunctionProperties<T>
251+
>z : NonFunctionProperties<T>
252252

253253
x = y; // Error
254-
>x = y : Pick<T, FunctionPropertyNames<T>>
254+
>x = y : FunctionProperties<T>
255255
>x : T
256-
>y : Pick<T, FunctionPropertyNames<T>>
256+
>y : FunctionProperties<T>
257257

258258
x = z; // Error
259-
>x = z : Pick<T, NonFunctionPropertyNames<T>>
259+
>x = z : NonFunctionProperties<T>
260260
>x : T
261-
>z : Pick<T, NonFunctionPropertyNames<T>>
261+
>z : NonFunctionProperties<T>
262262

263263
y = x;
264264
>y = x : T
265-
>y : Pick<T, FunctionPropertyNames<T>>
265+
>y : FunctionProperties<T>
266266
>x : T
267267

268268
y = z; // Error
269-
>y = z : Pick<T, NonFunctionPropertyNames<T>>
270-
>y : Pick<T, FunctionPropertyNames<T>>
271-
>z : Pick<T, NonFunctionPropertyNames<T>>
269+
>y = z : NonFunctionProperties<T>
270+
>y : FunctionProperties<T>
271+
>z : NonFunctionProperties<T>
272272

273273
z = x;
274274
>z = x : T
275-
>z : Pick<T, NonFunctionPropertyNames<T>>
275+
>z : NonFunctionProperties<T>
276276
>x : T
277277

278278
z = y; // Error
279-
>z = y : Pick<T, FunctionPropertyNames<T>>
280-
>z : Pick<T, NonFunctionPropertyNames<T>>
281-
>y : Pick<T, FunctionPropertyNames<T>>
279+
>z = y : FunctionProperties<T>
280+
>z : NonFunctionProperties<T>
281+
>y : FunctionProperties<T>
282282
}
283283

284284
function f8<T>(x: keyof T, y: FunctionPropertyNames<T>, z: NonFunctionPropertyNames<T>) {

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export type Foo<Y> = Bar<any, Y>;
88
export const y = (x: Foo<string>) => 1
99
>y : (x: Foo<string>) => number
1010
>(x: Foo<string>) => 1 : (x: Foo<string>) => number
11-
>x : Bar<any, string>
11+
>x : Foo<string>
1212
>1 : 1
1313

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters2.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export type Baa<Y> = Baz<boolean, Y>;
1111
export const y = (x: Baa<number>) => 1
1212
>y : (x: Baa<number>) => number
1313
>(x: Baa<number>) => 1 : (x: Baa<number>) => number
14-
>x : Bar<boolean, string, number>
14+
>x : Baa<number>
1515
>1 : 1
1616

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ declare type Foo<T, Y> = {
2020
foo<U, J>(): Foo<U, J>;
2121
};
2222
declare type SubFoo<R> = Foo<string, R>;
23-
declare function foo(): Foo<string, number>;
23+
declare function foo(): SubFoo<number>;

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters4.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ type SubFoo<R> = Foo<string, R>;
1010
>SubFoo : SubFoo<R>
1111

1212
function foo() {
13-
>foo : () => Foo<string, number>
13+
>foo : () => SubFoo<number>
1414

1515
return {} as SubFoo<number>;
16-
>{} as SubFoo<number> : Foo<string, number>
16+
>{} as SubFoo<number> : SubFoo<number>
1717
>{} : {}
1818
}
1919

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters5.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export type SubFoo<R> = Foo<string, R>;
1010
>SubFoo : SubFoo<R>
1111

1212
function foo() {
13-
>foo : () => Foo<string, number>
13+
>foo : () => SubFoo<number>
1414

1515
return {} as SubFoo<number>;
16-
>{} as SubFoo<number> : Foo<string, number>
16+
>{} as SubFoo<number> : SubFoo<number>
1717
>{} : {}
1818
}
1919

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ declare type Foo<T, Y> = {
2020
foo<U, J>(): Foo<U, J>;
2121
};
2222
declare type SubFoo<R, S> = Foo<S, R>;
23-
declare function foo(): Foo<string, number>;
23+
declare function foo(): SubFoo<number, string>;

tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters6.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ type SubFoo<R, S> = Foo<S, R>;
1010
>SubFoo : SubFoo<R, S>
1111

1212
function foo() {
13-
>foo : () => Foo<string, number>
13+
>foo : () => SubFoo<number, string>
1414

1515
return {} as SubFoo<number, string>;
16-
>{} as SubFoo<number, string> : Foo<string, number>
16+
>{} as SubFoo<number, string> : SubFoo<number, string>
1717
>{} : {}
1818
}
1919

tests/baselines/reference/discriminantPropertyCheck.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,18 +464,18 @@ type TypeBar2 = { type: BarEnum.bar2 };
464464

465465
function func3(value: Partial<UnionOfBar>) {
466466
>func3 : (value: Partial<UnionOfBar>) => void
467-
>value : Partial<TypeBar1> | Partial<TypeBar2>
467+
>value : Partial<UnionOfBar>
468468

469469
if (value.type !== undefined) {
470470
>value.type !== undefined : boolean
471471
>value.type : BarEnum | undefined
472-
>value : Partial<TypeBar1> | Partial<TypeBar2>
472+
>value : Partial<UnionOfBar>
473473
>type : BarEnum | undefined
474474
>undefined : undefined
475475

476476
switch (value.type) {
477477
>value.type : BarEnum
478-
>value : Partial<TypeBar1> | Partial<TypeBar2>
478+
>value : Partial<UnionOfBar>
479479
>type : BarEnum
480480

481481
case BarEnum.bar1:
@@ -495,7 +495,7 @@ function func3(value: Partial<UnionOfBar>) {
495495
>never(value.type) : never
496496
>never : (value: never) => never
497497
>value.type : never
498-
>value : Partial<TypeBar1> | Partial<TypeBar2>
498+
>value : Partial<UnionOfBar>
499499
>type : never
500500
}
501501
}

0 commit comments

Comments
 (0)