mixing generics, Pick, Exclude and intersection types fails to compile in 3.1.0 #28274
Labels
Bug
A bug in TypeScript
Domain: Indexed Access Types
The issue relates to accessing subtypes via index access
Milestone
TypeScript Version: 3.2.0-dev.20181031
Search Terms: generic pick exclude keyof intersection spread
Code
Expected behavior:
The line annotated "fails unexpectedly" should compile successfully.
AFAICT this change happened between
3.1.0-dev.20180825
and3.1.0-dev.20180828
.Actual behavior:
The line annotated "fails unexpectedly" does not compile, though it used to in earlier versions.
The error reported is
But
TWithFoo
is specifically defined to ignore any existingfoo
key and replace it withstring
.Playground Link: link
Related Issues: #27201, #27928
The text was updated successfully, but these errors were encountered: