Skip to content

Commit 2801c97

Browse files
committed
Accept new baselines
1 parent c0c215f commit 2801c97

File tree

4 files changed

+22
-31
lines changed

4 files changed

+22
-31
lines changed

tests/baselines/reference/infiniteConstraints.errors.txt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, number>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, number>>], Record<"val", string>>["val"]'.
2-
error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, string>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, string>>], Record<"val", string>>["val"]'.
3-
error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, symbol>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, symbol>>], Record<"val", string>>["val"]'.
41
tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' cannot be used to index type 'B[Exclude<keyof B, K>]'.
5-
tests/cases/compiler/infiniteConstraints.ts(27,37): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
6-
tests/cases/compiler/infiniteConstraints.ts(27,58): error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'.
7-
tests/cases/compiler/infiniteConstraints.ts(29,45): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
82
tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'.
93
tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'.
104
tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'.
115

126

13-
!!! error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, number>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, number>>], Record<"val", string>>["val"]'.
14-
!!! error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, string>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, string>>], Record<"val", string>>["val"]'.
15-
!!! error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, symbol>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, symbol>>], Record<"val", string>>["val"]'.
16-
==== tests/cases/compiler/infiniteConstraints.ts (7 errors) ====
7+
==== tests/cases/compiler/infiniteConstraints.ts (4 errors) ====
178
// Both of the following types trigger the recursion limiter in getImmediateBaseConstraint
189

1910
type T1<B extends { [K in keyof B]: Extract<B[Exclude<keyof B, K>], { val: string }>["val"] }> = B;
@@ -43,17 +34,8 @@ tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' c
4334
>(vals: T): void;
4435

4536
const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
46-
~~~~
47-
!!! error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
48-
!!! related TS6500 tests/cases/compiler/infiniteConstraints.ts:27:37: The expected type comes from property 'main' which is declared here on type '{ main: never; alternate: never; }'
49-
~~~~~~~~~
50-
!!! error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'.
51-
!!! related TS6500 tests/cases/compiler/infiniteConstraints.ts:27:58: The expected type comes from property 'alternate' which is declared here on type '{ main: never; alternate: never; }'
5237

5338
const shouldBeNoError = ensureNoDuplicates({main: value("test")});
54-
~~~~
55-
!!! error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
56-
!!! related TS6500 tests/cases/compiler/infiniteConstraints.ts:29:45: The expected type comes from property 'main' which is declared here on type '{ main: never; }'
5739

5840
const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
5941
~~~~

tests/baselines/reference/infiniteConstraints.types

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ declare function value<V extends string>(val: V): Value<V>;
3939
>val : V
4040

4141
declare function ensureNoDuplicates<
42-
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
42+
>ensureNoDuplicates : <T extends { [K in keyof T]: Extract<T[K], Record<"val", string>>["val"] extends Extract<T[Exclude<keyof T, K>], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void
4343

4444
T extends {
4545
[K in keyof T]: Extract<T[K], Value>["val"] extends Extract<T[Exclude<keyof T, K>], Value>["val"]
@@ -50,9 +50,9 @@ declare function ensureNoDuplicates<
5050
>vals : T
5151

5252
const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
53-
>noError : any
54-
>ensureNoDuplicates({main: value("test"), alternate: value("test2")}) : any
55-
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
53+
>noError : void
54+
>ensureNoDuplicates({main: value("test"), alternate: value("test2")}) : void
55+
>ensureNoDuplicates : <T extends { [K in keyof T]: Extract<T[K], Record<"val", string>>["val"] extends Extract<T[Exclude<keyof T, K>], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void
5656
>{main: value("test"), alternate: value("test2")} : { main: Record<"val", "test">; alternate: Record<"val", "test2">; }
5757
>main : Record<"val", "test">
5858
>value("test") : Record<"val", "test">
@@ -64,9 +64,9 @@ const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2
6464
>"test2" : "test2"
6565

6666
const shouldBeNoError = ensureNoDuplicates({main: value("test")});
67-
>shouldBeNoError : any
68-
>ensureNoDuplicates({main: value("test")}) : any
69-
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
67+
>shouldBeNoError : void
68+
>ensureNoDuplicates({main: value("test")}) : void
69+
>ensureNoDuplicates : <T extends { [K in keyof T]: Extract<T[K], Record<"val", string>>["val"] extends Extract<T[Exclude<keyof T, K>], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void
7070
>{main: value("test")} : { main: Record<"val", "test">; }
7171
>main : Record<"val", "test">
7272
>value("test") : Record<"val", "test">
@@ -76,7 +76,7 @@ const shouldBeNoError = ensureNoDuplicates({main: value("test")});
7676
const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
7777
>shouldBeError : any
7878
>ensureNoDuplicates({main: value("dup"), alternate: value("dup")}) : any
79-
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
79+
>ensureNoDuplicates : <T extends { [K in keyof T]: Extract<T[K], Record<"val", string>>["val"] extends Extract<T[Exclude<keyof T, K>], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void
8080
>{main: value("dup"), alternate: value("dup")} : { main: Record<"val", "dup">; alternate: Record<"val", "dup">; }
8181
>main : Record<"val", "dup">
8282
>value("dup") : Record<"val", "dup">

tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
33
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(9,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
44
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(12,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
55
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(15,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
6-
Type 'string' is not assignable to type 'never'.
76
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(18,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
87
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
98
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(24,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
109
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(27,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
1110
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(30,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
12-
Type 'string' is not assignable to type 'number'.
1311

1412

1513
==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts (10 errors) ====
@@ -38,7 +36,6 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
3836
tp = s;
3937
~~
4038
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
41-
!!! error TS2322: Type 'string' is not assignable to type 'never'.
4239
}
4340
function k<T extends number, P extends keyof T>(s: string, tp: T[P]): void {
4441
tp = s;
@@ -64,6 +61,5 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
6461
tp = s;
6562
~~
6663
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
67-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
6864
}
6965

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts(5,5): error TS2322: Type 'undefined' is not assignable to type 'Errors<T>[keyof T]'.
2+
3+
4+
==== tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts (1 errors) ====
5+
type Errors<T> = { [P in keyof T]: string | undefined } & {all: string | undefined};
6+
function foo<T>() {
7+
let obj!: Errors<T>
8+
let x!: keyof T;
9+
obj[x] = undefined;
10+
~~~~~~
11+
!!! error TS2322: Type 'undefined' is not assignable to type 'Errors<T>[keyof T]'.
12+
}
13+

0 commit comments

Comments
 (0)