Skip to content

Conversation

@mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Nov 5, 2025

Adjusts our typings to work better with recursive types and avoid infinite recursion in the type system.

@mmalerba mmalerba requested review from kirjs and leonsenft November 5, 2025 00:44
@mmalerba mmalerba added area: forms target: rc This PR is targeted for the next release-candidate forms: signals labels Nov 5, 2025
@ngbot ngbot bot added this to the Backlog milestone Nov 5, 2025
Adjusts our typings to work better with recursive types and avoid
infinite recursion in the type system.
// type RecursiveType = (number | RecursiveType)[]
// type Test = FieldTree<RecursiveType> // Infinite type recursion if condition distributes.
// ```
(TValue & {} extends Array<infer U>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same issue we encountered with the compat types right? Is there a reason we solved it here using TValue & {} extends Array<infer U> instead of [TValue] extends [Array<infer U>] like we did with the compat types and is recommended in the linked docs?

@pullapprove pullapprove bot requested a review from devversion November 5, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: forms forms: signals target: rc This PR is targeted for the next release-candidate

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants