-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Stack overflow with incorrect mapped type as constraint of type parameter #17847
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
Comments
I'm having a similar issue to this, but can't reproduce the issue in a minimal case. In the minimal case it works properly, but inside of my project, I have this same stack trace, but my code is: export type MatchQuery<T> = {
[P in keyof T]?: T[P] | MatchQuery<T[P]>
}; |
@arciisine for that small of a repro, there's nothing to cause the compiler to start checking the insides of the mapped type. As soon as you add some code that uses the mapped type you should see the crash. |
I actually have a larger minimal case, that doesn't cause it to happen. It appears to be something along the way, that I'm going to try to narrow down and see if I can hit that a minimal repro. Btw, I have many versions of the recursive mapped type that do not throw any errors, but this one in specific seems to be problematic. |
Fixed by #17912 |
The call to I have a fix that clones |
This incorrect code puts the compiler in an infinite loop:
The text was updated successfully, but these errors were encountered: