-
Notifications
You must be signed in to change notification settings - Fork 13k
Use Partial<T> instead of Omit<T, keyof T> when rest spreading #62573
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
Conversation
Implements suggestion from microsoft#62572
@copilot add testcases for this PR |
@typescript-bot test it |
function isOrContainsKeyofT(keyType: Type, sourceType: Type): boolean { | ||
if (keyType.flags & TypeFlags.Union) { | ||
return !!forEach((keyType as UnionType).types, t => isOrContainsKeyofT(t, sourceType)); | ||
} | ||
if (keyType.flags & TypeFlags.Index && (keyType as IndexType).type === sourceType) { | ||
return true; | ||
} | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this traversal could be just a call to someType
.
Hey @RyanCavanaugh, the results of running the DT tests are ready. Everything looks the same! |
@RyanCavanaugh Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
@RyanCavanaugh Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@RyanCavanaugh Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
…revious-commit Add testcases for Partial<T> rest spreading with keyof T
#62572 seemed like a good idea worth trying