Skip to content

Commit 1fb6f11

Browse files
committed
Accept new baselines
1 parent 316739e commit 1fb6f11

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

tests/baselines/reference/infiniteConstraints.errors.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
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"]'.
12
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'.
29
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; }'.
310
Types of property 'main' are incompatible.
411
Type 'Record<"val", "dup">' is not assignable to type 'never'.
512
tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'.
613

714

8-
==== tests/cases/compiler/infiniteConstraints.ts (3 errors) ====
15+
!!! 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) ====
917
// Both of the following types trigger the recursion limiter in getImmediateBaseConstraint
1018

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

3745
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'.
3850

3951
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'.
4056

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

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]: Extract<T[K], Record<"val", string>>["val"] extends Extract<T[Exclude<keyof T, K>], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void
42+
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(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 : 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
53+
>noError : any
54+
>ensureNoDuplicates({main: value("test"), alternate: value("test2")}) : any
55+
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(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 : 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
67+
>shouldBeNoError : any
68+
>ensureNoDuplicates({main: value("test")}) : any
69+
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(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]: Extract<T[K], Record<"val", string>>["val"] extends Extract<T[Exclude<keyof T, K>], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void
79+
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(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">

0 commit comments

Comments
 (0)