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
// If the mapped type isn't `keyof` constraint-declared, _but_ still has modifiers preserved, and its naive instantiation won't preserve modifiers because its constraint isn't `keyof` constrained, we have work to do
// We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/compiler/declarationEmitMappedTypeDistributivityPreservesConstraints.js
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/compiler/declarationEmitMappedTypeDistributivityPreservesConstraints.js.diff
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/compiler/declarationEmitMappedTypeDistributivityPreservesConstraints.types
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/compiler/declarationEmitMappedTypeDistributivityPreservesConstraints.types.diff
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/compiler/declarationEmitMappedTypePreservesTypeParameterConstraint.js
+2-56Lines changed: 2 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -94,67 +94,13 @@ export declare type ZodRawShape = {
declarationEmitMappedTypePreservesTypeParameterConstraint.d.ts(24,82): error TS2536: Type 'k' cannot be used to index type 'addQuestionMarks<baseObjectOutputType<{version: ZodLiteral<V>;}>, undefined extends V ? never : "version">'.
115
-
declarationEmitMappedTypePreservesTypeParameterConstraint.d.ts(34,210): errorTS2536: Type 'k' cannotbeusedtoindextype '{[k_1inkeyofo]-?: [k_1,o[k_1]&({}|null)];}[o extends readonly unknown[] ? keyof o &number : keyofo]'.
}>, undefined extends V ? never : "version">extendsinferT ? {[kinkeyofT]: addQuestionMarks<baseObjectOutputType<{
143
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144
-
version: ZodLiteral<V>;
145
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
146
-
}>,undefinedextendsV ? never : "version">[k];} : never;
147
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148
-
!!! error TS2536: Type 'k' cannot be used to index type 'addQuestionMarks<baseObjectOutputType<{version: ZodLiteral<V>;}>, undefined extends V ? never : "version">'.
149
-
typeevaluate<t> = {
150
-
[kinkeyoft]: t[k];
151
-
}&unknown;
152
-
exporttypeentryOf<o> = evaluate<{
153
-
[kinkeyofo]-?: [k,o[k]&({}|null)];
154
-
}[o extends readonly unknown[] ? keyof o &number : keyofo]>;
0 commit comments