Accept new baselines
This commit is contained in:
parent
c0c215fb66
commit
2801c97164
4 changed files with 22 additions and 31 deletions
|
@ -1,19 +1,10 @@
|
||||||
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"]'.
|
|
||||||
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"]'.
|
|
||||||
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"]'.
|
|
||||||
tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' cannot be used to index type 'B[Exclude<keyof B, K>]'.
|
tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' cannot be used to index type 'B[Exclude<keyof B, K>]'.
|
||||||
tests/cases/compiler/infiniteConstraints.ts(27,37): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
|
|
||||||
tests/cases/compiler/infiniteConstraints.ts(27,58): error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'.
|
|
||||||
tests/cases/compiler/infiniteConstraints.ts(29,45): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
|
|
||||||
tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'.
|
tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'.
|
||||||
tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'.
|
tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'.
|
||||||
tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'.
|
tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'.
|
||||||
|
|
||||||
|
|
||||||
!!! 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"]'.
|
==== tests/cases/compiler/infiniteConstraints.ts (4 errors) ====
|
||||||
!!! 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"]'.
|
|
||||||
!!! 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"]'.
|
|
||||||
==== tests/cases/compiler/infiniteConstraints.ts (7 errors) ====
|
|
||||||
// Both of the following types trigger the recursion limiter in getImmediateBaseConstraint
|
// Both of the following types trigger the recursion limiter in getImmediateBaseConstraint
|
||||||
|
|
||||||
type T1<B extends { [K in keyof B]: Extract<B[Exclude<keyof B, K>], { val: string }>["val"] }> = B;
|
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
|
||||||
>(vals: T): void;
|
>(vals: T): void;
|
||||||
|
|
||||||
const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
|
const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
|
||||||
~~~~
|
|
||||||
!!! error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
|
|
||||||
!!! 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; }'
|
|
||||||
~~~~~~~~~
|
|
||||||
!!! error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'.
|
|
||||||
!!! 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; }'
|
|
||||||
|
|
||||||
const shouldBeNoError = ensureNoDuplicates({main: value("test")});
|
const shouldBeNoError = ensureNoDuplicates({main: value("test")});
|
||||||
~~~~
|
|
||||||
!!! error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'.
|
|
||||||
!!! related TS6500 tests/cases/compiler/infiniteConstraints.ts:29:45: The expected type comes from property 'main' which is declared here on type '{ main: never; }'
|
|
||||||
|
|
||||||
const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
|
const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
|
||||||
~~~~
|
~~~~
|
||||||
|
|
|
@ -39,7 +39,7 @@ declare function value<V extends string>(val: V): Value<V>;
|
||||||
>val : V
|
>val : V
|
||||||
|
|
||||||
declare function ensureNoDuplicates<
|
declare function ensureNoDuplicates<
|
||||||
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
|
>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
|
||||||
|
|
||||||
T extends {
|
T extends {
|
||||||
[K in keyof T]: Extract<T[K], Value>["val"] extends Extract<T[Exclude<keyof T, K>], Value>["val"]
|
[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<
|
||||||
>vals : T
|
>vals : T
|
||||||
|
|
||||||
const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
|
const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2")});
|
||||||
>noError : any
|
>noError : void
|
||||||
>ensureNoDuplicates({main: value("test"), alternate: value("test2")}) : any
|
>ensureNoDuplicates({main: value("test"), alternate: value("test2")}) : void
|
||||||
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
|
>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
|
||||||
>{main: value("test"), alternate: value("test2")} : { main: Record<"val", "test">; alternate: Record<"val", "test2">; }
|
>{main: value("test"), alternate: value("test2")} : { main: Record<"val", "test">; alternate: Record<"val", "test2">; }
|
||||||
>main : Record<"val", "test">
|
>main : Record<"val", "test">
|
||||||
>value("test") : Record<"val", "test">
|
>value("test") : Record<"val", "test">
|
||||||
|
@ -64,9 +64,9 @@ const noError = ensureNoDuplicates({main: value("test"), alternate: value("test2
|
||||||
>"test2" : "test2"
|
>"test2" : "test2"
|
||||||
|
|
||||||
const shouldBeNoError = ensureNoDuplicates({main: value("test")});
|
const shouldBeNoError = ensureNoDuplicates({main: value("test")});
|
||||||
>shouldBeNoError : any
|
>shouldBeNoError : void
|
||||||
>ensureNoDuplicates({main: value("test")}) : any
|
>ensureNoDuplicates({main: value("test")}) : void
|
||||||
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
|
>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
|
||||||
>{main: value("test")} : { main: Record<"val", "test">; }
|
>{main: value("test")} : { main: Record<"val", "test">; }
|
||||||
>main : Record<"val", "test">
|
>main : Record<"val", "test">
|
||||||
>value("test") : Record<"val", "test">
|
>value("test") : Record<"val", "test">
|
||||||
|
@ -76,7 +76,7 @@ const shouldBeNoError = ensureNoDuplicates({main: value("test")});
|
||||||
const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
|
const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")});
|
||||||
>shouldBeError : any
|
>shouldBeError : any
|
||||||
>ensureNoDuplicates({main: value("dup"), alternate: value("dup")}) : any
|
>ensureNoDuplicates({main: value("dup"), alternate: value("dup")}) : any
|
||||||
>ensureNoDuplicates : <T extends { [K in keyof T]: never; }>(vals: T) => void
|
>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
|
||||||
>{main: value("dup"), alternate: value("dup")} : { main: Record<"val", "dup">; alternate: Record<"val", "dup">; }
|
>{main: value("dup"), alternate: value("dup")} : { main: Record<"val", "dup">; alternate: Record<"val", "dup">; }
|
||||||
>main : Record<"val", "dup">
|
>main : Record<"val", "dup">
|
||||||
>value("dup") : Record<"val", "dup">
|
>value("dup") : Record<"val", "dup">
|
||||||
|
|
|
@ -3,13 +3,11 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(9,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(9,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(12,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(12,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(15,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(15,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
Type 'string' is not assignable to type 'never'.
|
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(18,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(18,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(24,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(24,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(27,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(27,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(30,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(30,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
Type 'string' is not assignable to type 'number'.
|
|
||||||
|
|
||||||
|
|
||||||
==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts (10 errors) ====
|
==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts (10 errors) ====
|
||||||
|
@ -38,7 +36,6 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
|
||||||
tp = s;
|
tp = s;
|
||||||
~~
|
~~
|
||||||
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
!!! error TS2322: Type 'string' is not assignable to type 'never'.
|
|
||||||
}
|
}
|
||||||
function k<T extends number, P extends keyof T>(s: string, tp: T[P]): void {
|
function k<T extends number, P extends keyof T>(s: string, tp: T[P]): void {
|
||||||
tp = s;
|
tp = s;
|
||||||
|
@ -64,6 +61,5 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
|
||||||
tp = s;
|
tp = s;
|
||||||
~~
|
~~
|
||||||
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
|
||||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts(5,5): error TS2322: Type 'undefined' is not assignable to type 'Errors<T>[keyof T]'.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts (1 errors) ====
|
||||||
|
type Errors<T> = { [P in keyof T]: string | undefined } & {all: string | undefined};
|
||||||
|
function foo<T>() {
|
||||||
|
let obj!: Errors<T>
|
||||||
|
let x!: keyof T;
|
||||||
|
obj[x] = undefined;
|
||||||
|
~~~~~~
|
||||||
|
!!! error TS2322: Type 'undefined' is not assignable to type 'Errors<T>[keyof T]'.
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue