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
Revert structuredTypeRelatedTo change and fix isUnitLikeType #51076
Changes from 3 commits
8ff245f
8fd5e4c
e363198
068d3de
8047229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,3 +402,32 @@ function doSomething2(value: unknown): void { | |
value; | ||
} | ||
} | ||
|
||
// Repro from #51009 | ||
|
||
type TypeA = { | ||
A: 'A', | ||
B: 'B', | ||
} | ||
|
||
type TypeB = { | ||
A: 'A', | ||
B: 'B', | ||
C: 'C', | ||
} | ||
|
||
type R<T extends keyof TypeA> = | ||
T extends keyof TypeB ? [TypeA[T], TypeB[T]] : never | ||
|
||
type R2<T extends PropertyKey> = | ||
T extends keyof TypeA ? | ||
T extends keyof TypeB ? | ||
[TypeA[T], TypeB[T]] : never: never | ||
|
||
// Repro from #51041 | ||
|
||
type AB = "A" | "B" | ||
|
||
function x<T_AB extends AB>(x: T_AB & undefined, y: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the change itself probably makes sense - but why is this test in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was a regression caused by #50735, so I added it in the same location as the tests for that PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DanielRosenwasser Otherwise good with this? I'd like to get it merged. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like if you could move it, that would be ideal - other than that, the change looks reasonable to me. |
||
let r2: never = y as T_AB & undefined; | ||
} |
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.
nit:
note that accepting this would require regenerating the baselines