You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(27,14): error TS2322: Type 'Pick<Params, ExcludeWithDefault<keyof Params, never, never>>' is not assignable to type 'Params'.
2
+
'Pick<Params, ExcludeWithDefault<keyof Params, never, never>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
3
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(31,5): error TS2322: Type 'T' is not assignable to type 'ExcludeWithDefault<T, never, never>'.
4
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(36,14): error TS2322: Type 'Pick<Params, ExtractWithDefault<keyof Params, keyof Params, never>>' is not assignable to type 'Params'.
5
+
'Pick<Params, ExtractWithDefault<keyof Params, keyof Params, never>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
6
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(40,5): error TS2322: Type 'T' is not assignable to type 'ExtractWithDefault<T, T, never>'.
7
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(47,14): error TS2322: Type 'Pick<Params, TemplatedConditional<keyof Params, never, never, keyof Params>>' is not assignable to type 'Params'.
8
+
'Pick<Params, TemplatedConditional<keyof Params, never, never, keyof Params>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
9
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(51,5): error TS2322: Type 'T' is not assignable to type 'TemplatedConditional<T, never, never, T>'.
10
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(56,14): error TS2322: Type 'Pick<Params, TemplatedConditional<keyof Params, keyof Params, keyof Params, never>>' is not assignable to type 'Params'.
11
+
'Pick<Params, TemplatedConditional<keyof Params, keyof Params, keyof Params, never>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
12
+
tests/cases/compiler/conditionalTypesSimplifyWhenTrivial.ts(60,5): error TS2322: Type 'T' is not assignable to type 'TemplatedConditional<T, T, T, never>'.
!!! error TS2322: Type 'Pick<Params, ExcludeWithDefault<keyof Params, never, never>>' is not assignable to type 'Params'.
45
+
!!! error TS2322: 'Pick<Params, ExcludeWithDefault<keyof Params, never, never>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
46
+
47
+
function fn6<T>(x: ExcludeWithDefault<T, never>) {
48
+
var y: T = x;
49
+
x = y;
50
+
~
51
+
!!! error TS2322: Type 'T' is not assignable to type 'ExcludeWithDefault<T, never, never>'.
!!! error TS2322: Type 'Pick<Params, ExtractWithDefault<keyof Params, keyof Params, never>>' is not assignable to type 'Params'.
59
+
!!! error TS2322: 'Pick<Params, ExtractWithDefault<keyof Params, keyof Params, never>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
60
+
61
+
function fn8<T>(x: ExtractWithDefault<T, T>) {
62
+
var y: T = x;
63
+
x = y;
64
+
~
65
+
!!! error TS2322: Type 'T' is not assignable to type 'ExtractWithDefault<T, T, never>'.
!!! error TS2322: Type 'Pick<Params, TemplatedConditional<keyof Params, never, never, keyof Params>>' is not assignable to type 'Params'.
75
+
!!! error TS2322: 'Pick<Params, TemplatedConditional<keyof Params, never, never, keyof Params>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
76
+
77
+
function fn10<T>(x: TemplatedConditional<T, never, never, T>) {
78
+
var y: T = x;
79
+
x = y;
80
+
~
81
+
!!! error TS2322: Type 'T' is not assignable to type 'TemplatedConditional<T, never, never, T>'.
!!! error TS2322: Type 'Pick<Params, TemplatedConditional<keyof Params, keyof Params, keyof Params, never>>' is not assignable to type 'Params'.
89
+
!!! error TS2322: 'Pick<Params, TemplatedConditional<keyof Params, keyof Params, keyof Params, never>>' is assignable to the constraint of type 'Params', but 'Params' could be instantiated with a different subtype of constraint '{}'.
90
+
91
+
function fn12<T>(x: TemplatedConditional<T, T, T, never>) {
92
+
var y: T = x;
93
+
x = y;
94
+
~
95
+
!!! error TS2322: Type 'T' is not assignable to type 'TemplatedConditional<T, T, T, never>'.
96
+
}
97
+
98
+
declare var z: any;
99
+
const zee = z!!!; // since x is `any`, `x extends null | undefined` should be both true and false - and thus yield `any`
0 commit comments