-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Investigate new RWC failures #32340
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
minimal repro: function f<T extends { x: {} }>(): Partial<T> {
return undefined! as T;
// Type 'T' is not assignable to type 'Partial<T>'.
// Type '{ x: {}; }' is not assignable to type 'Partial<T>'.ts(2322)
} |
Confirmed reverting #32071 makes the error go away :/ |
When we make the intersection of keys there, we should just have |
type Partial<T> = { [P in keyof T]?: T[P]; }
function f<T extends { x: {} }>(): Partial<T> {
return undefined! as T;
} Ok, so stepping through the code how it was before #32071:
What happens after #32071:
|
So... We just need to intersect the target type parameter into the type we index with, so it's |
That seems to do the trick. |
We haven't merged our RWC failures from the last 9 days and they've really added up (which is, I assume, why nobody is looking at them or merging them). Most of them are benign - error span/message changes for the new overload errors, some expected duplicate definition errors related to the
Generator
types change and oldernode
declaration files. However, there's one pattern of changes alone these lines (mostly within s4l):that's suuuuuper concerning, since a
T
is pretty much always supposed to be assignable to aPartial<T>
, meaning we've broken something pretty important ❤️I've merged the current baselines so we can actually browse thru the diffs again, but this particular regression needs to be seriously investigated and addressed. Best guess is that #32071 interacted poorly with another change added to
master
(or the other failure inmaster
hid this one) over the same period, but I dunno.The text was updated successfully, but these errors were encountered: