|
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"]'. |
4 | 1 | 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'. |
8 | 2 | tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. |
9 | 3 | tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. |
10 | 4 | tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'. |
11 | 5 |
|
12 | 6 |
|
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) ==== |
17 | 8 | // Both of the following types trigger the recursion limiter in getImmediateBaseConstraint |
18 | 9 |
|
19 | 10 | 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 |
43 | 34 | >(vals: T): void; |
44 | 35 |
|
45 | 36 | 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; }' |
52 | 37 |
|
53 | 38 | 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; }' |
57 | 39 |
|
58 | 40 | const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")}); |
59 | 41 | ~~~~ |
|
0 commit comments