|
1 | 1 | error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, string | number | symbol>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, string | number | symbol>>], Record<"val", string>>["val"]'.
|
2 | 2 | tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' cannot be used to index type 'B[Exclude<keyof B, K>]'.
|
3 |
| -tests/cases/compiler/infiniteConstraints.ts(27,36): error TS2345: Argument of type '{ main: Record<"val", "test">; alternate: Record<"val", "test2">; }' is not assignable to parameter of type '{ main: never; alternate: never; }'. |
4 |
| - Types of property 'main' are incompatible. |
5 |
| - Type 'Record<"val", "test">' is not assignable to type 'never'. |
6 |
| -tests/cases/compiler/infiniteConstraints.ts(29,44): error TS2345: Argument of type '{ main: Record<"val", "test">; }' is not assignable to parameter of type '{ main: never; }'. |
7 |
| - Types of property 'main' are incompatible. |
8 |
| - Type 'Record<"val", "test">' is not assignable to type 'never'. |
9 |
| -tests/cases/compiler/infiniteConstraints.ts(31,42): error TS2345: Argument of type '{ main: Record<"val", "dup">; alternate: Record<"val", "dup">; }' is not assignable to parameter of type '{ main: never; alternate: never; }'. |
10 |
| - Types of property 'main' are incompatible. |
11 |
| - Type 'Record<"val", "dup">' is not assignable to type 'never'. |
| 3 | +tests/cases/compiler/infiniteConstraints.ts(27,37): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'. |
| 4 | +tests/cases/compiler/infiniteConstraints.ts(27,58): error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'. |
| 5 | +tests/cases/compiler/infiniteConstraints.ts(29,45): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'. |
| 6 | +tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. |
| 7 | +tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. |
12 | 8 | tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'.
|
13 | 9 |
|
14 | 10 |
|
15 | 11 | !!! error TS2321: Excessive stack depth comparing types 'Extract<T[Exclude<keyof T, string | number | symbol>], Record<"val", string>>["val"]' and 'Extract<T[Exclude<keyof T, Exclude<keyof T, string | number | symbol>>], Record<"val", string>>["val"]'.
|
16 |
| -==== tests/cases/compiler/infiniteConstraints.ts (5 errors) ==== |
| 12 | +==== tests/cases/compiler/infiniteConstraints.ts (7 errors) ==== |
17 | 13 | // Both of the following types trigger the recursion limiter in getImmediateBaseConstraint
|
18 | 14 |
|
19 | 15 | type T1<B extends { [K in keyof B]: Extract<B[Exclude<keyof B, K>], { val: string }>["val"] }> = B;
|
@@ -43,16 +39,17 @@ tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' c
|
43 | 39 | >(vals: T): void;
|
44 | 40 |
|
45 | 41 | const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
|
46 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
47 |
| -!!! error TS2345: Argument of type '{ main: Record<"val", "test">; alternate: Record<"val", "test2">; }' is not assignable to parameter of type '{ main: never; alternate: never; }'. |
48 |
| -!!! error TS2345: Types of property 'main' are incompatible. |
49 |
| -!!! error TS2345: Type 'Record<"val", "test">' is not assignable to type 'never'. |
| 42 | + ~~~~ |
| 43 | +!!! error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'. |
| 44 | +!!! 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; }' |
| 45 | + ~~~~~~~~~ |
| 46 | +!!! error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'. |
| 47 | +!!! 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; }' |
50 | 48 |
|
51 | 49 | const shouldBeNoError = ensureNoDuplicates({main: value("test")});
|
52 |
| - ~~~~~~~~~~~~~~~~~~~~~ |
53 |
| -!!! error TS2345: Argument of type '{ main: Record<"val", "test">; }' is not assignable to parameter of type '{ main: never; }'. |
54 |
| -!!! error TS2345: Types of property 'main' are incompatible. |
55 |
| -!!! error TS2345: Type 'Record<"val", "test">' is not assignable to type 'never'. |
| 50 | + ~~~~ |
| 51 | +!!! error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'. |
| 52 | +!!! related TS6500 tests/cases/compiler/infiniteConstraints.ts:29:45: The expected type comes from property 'main' which is declared here on type '{ main: never; }' |
56 | 53 |
|
57 | 54 | const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
|
58 | 55 | ~~~~
|
|
0 commit comments