Skip to content

Avoid resolving source prop type when the target is unknown/any #61660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge remote-tracking branch 'origin/main' into avoid-circularity-on-…
…any-unknown-target-props
  • Loading branch information
Andarist committed Jun 6, 2025
commit a563d6b22f1560a6d212c969192ccb4069a80557
1 change: 0 additions & 1 deletion tests/baselines/reference/multiline.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

=== Performance Stats ===
Type Count: 2,500
Instantiation count: 1,000

=== a.ts ===
export const texts: string[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ type Prettify<T> = { [K in keyof T]: T[K] } & {};
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^

type InferObjectType<Shape extends ZodShape> = Prettify<
>InferObjectType : { [k in keyof Shape as Shape[k] extends { optional: "true"; } ? k : never]?: Shape[k]["output"] | undefined; } & { [k_1 in keyof Shape as Shape[k_1] extends { optional: "true"; } ? never : k_1]: Shape[k_1]["output"]; } extends infer T ? { [K in keyof T]: ({ [k in keyof Shape as Shape[k] extends { optional: "true"; } ? k : never]?: Shape[k]["output"] | undefined; } & { [k_1 in keyof Shape as Shape[k_1] extends { optional: "true"; } ? never : k_1]: Shape[k_1]["output"]; })[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>InferObjectType : { [k in keyof Shape as Shape[k] extends { optional: "true"; } ? k : never]?: Shape[k]["output"] | undefined; } & { [k_1 in keyof Shape as Shape[k_1] extends { optional: "true"; } ? never : k_1]: Shape[k_1]["output"]; } extends infer T ? { [K in keyof T]: T[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
{
[k in keyof Shape as Shape[k] extends { optional: "true" }
>optional : "true"
Expand All @@ -55,8 +55,8 @@ interface ZodObject<T extends ZodShape> extends ZodType {
> : ^^^^^^^

output: InferObjectType<T>;
>output : { [k in keyof T as T[k] extends { optional: "true"; } ? k : never]?: T[k]["output"] | undefined; } & { [k_1 in keyof T as T[k_1] extends { optional: "true"; } ? never : k_1]: T[k_1]["output"]; } extends infer T_1 ? { [K in keyof T_1]: ({ [k in keyof T as T[k] extends { optional: "true"; } ? k : never]?: T[k]["output"] | undefined; } & { [k_1 in keyof T as T[k_1] extends { optional: "true"; } ? never : k_1]: T[k_1]["output"]; })[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>output : { [k in keyof T as T[k] extends { optional: "true"; } ? k : never]?: T[k]["output"] | undefined; } & { [k_1 in keyof T as T[k_1] extends { optional: "true"; } ? never : k_1]: T[k_1]["output"]; } extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

interface ZodOptional<T extends ZodType> extends ZodType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type Prettify<T> = { [K in keyof T]: T[K] } & {};
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^

type InferObjectType<Shape extends ZodShape> = Prettify<
>InferObjectType : { [k in keyof Shape as Shape[k] extends { optional: "true"; } ? k : never]?: Shape[k]["output"] | undefined; } & { [k_1 in keyof Shape as Shape[k_1] extends { optional: "true"; } ? never : k_1]: Shape[k_1]["output"]; } extends infer T ? { [K in keyof T]: ({ [k in keyof Shape as Shape[k] extends { optional: "true"; } ? k : never]?: Shape[k]["output"] | undefined; } & { [k_1 in keyof Shape as Shape[k_1] extends { optional: "true"; } ? never : k_1]: Shape[k_1]["output"]; })[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>InferObjectType : { [k in keyof Shape as Shape[k] extends { optional: "true"; } ? k : never]?: Shape[k]["output"] | undefined; } & { [k_1 in keyof Shape as Shape[k_1] extends { optional: "true"; } ? never : k_1]: Shape[k_1]["output"]; } extends infer T ? { [K in keyof T]: T[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
{
[k in keyof Shape as Shape[k] extends { optional: "true" }
>optional : "true"
Expand All @@ -53,8 +53,8 @@ interface ZodObject<T extends ZodShape> extends ZodType {
> : ^^^^^^^

output: InferObjectType<T>;
>output : { [k in keyof T as T[k] extends { optional: "true"; } ? k : never]?: T[k]["output"] | undefined; } & { [k_1 in keyof T as T[k_1] extends { optional: "true"; } ? never : k_1]: T[k_1]["output"]; } extends infer T_1 ? { [K in keyof T_1]: ({ [k in keyof T as T[k] extends { optional: "true"; } ? k : never]?: T[k]["output"] | undefined; } & { [k_1 in keyof T as T[k_1] extends { optional: "true"; } ? never : k_1]: T[k_1]["output"]; })[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>output : { [k in keyof T as T[k] extends { optional: "true"; } ? k : never]?: T[k]["output"] | undefined; } & { [k_1 in keyof T as T[k_1] extends { optional: "true"; } ? never : k_1]: T[k_1]["output"]; } extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

interface ZodOptional<T extends ZodType> extends ZodType {
Expand Down
3 changes: 0 additions & 3 deletions tests/baselines/reference/propTypeValidatorInference.types
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//// [tests/cases/compiler/propTypeValidatorInference.ts] ////

=== Performance Stats ===
Instantiation count: 1,000

=== node_modules/prop-types/index.d.ts ===
export const nominalTypeHack: unique symbol;
>nominalTypeHack : unique symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=== Performance Stats ===
Assignability cache: 2,500
Type Count: 10,000
Instantiation count: 100,000
Instantiation count: 50,000
Symbol count: 50,000

=== tsxReactPropsInferenceSucceedsOnIntersections.tsx ===
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy