-
-
Notifications
You must be signed in to change notification settings - Fork 575
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
4.23.0 introduced a breaking change in Paths
type
#922
Comments
Paths
type
// @fardolieri |
The change causing the regression: #920 |
Why do |
Oh that is really interesting. I created a trimmed down version that shows the problem Playground Link The example of @mwaibel-go only worked with the old version of If we look at the example
Meaning that typescript could go the reverse direction and create a type TLDR; The way @mwaibel-go used import { Paths } from "type-fest";
interface ColumnSortState<Sortee extends object> {
- column: Paths<Sortee>;
+ column: keyof Sortee;
}
function sort<Sortee extends Properties, Properties extends Record<any, any>>(
_sortees: Sortee[],
_sortState: ColumnSortState<Properties>,
): void {} If you actually want to use function sort<Sortee extends Record<any, any>>(
_sortees: Sortee[],
_sortState: ColumnSortState<Sortee>,
): void {} |
This is mwaibel-go’s alt account speaking.
It’s a minimal example. The original function requires access to both
That is interesting. I will need to check if my code has just been broken ever since, or if this is a result of creating a MWE. Thanks for pointing that out. @sindresorhus If you’d like to keep your issue queue small, you can close this. I will then create a new issue if I can find a reproduction that doesn’t involve broken code. Otherwise, I’ll respond again in about a week, since I’m on vacation right now. |
I’m sorry for the noise. I cannot reproduce the error. Thanks for pointing out the issue in my code, @fardolieri! |
I get this error with type-fest 4.23.0 that I didn’t get with 4.22.1:
Offending code (Stackblitz):
Upvote & Fund
The text was updated successfully, but these errors were encountered: