-
Notifications
You must be signed in to change notification settings - Fork 12.8k
No autocomplete when using something other than any on keyof extends generic #35682
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
There isn't a way to make the "inside" and "outside" of this function both work like you expect |
Hmmm.. Is there any specific reason why this works with
And not
? |
@RyanCavanaugh any reason for closing this issue ? I can clone it if you think it's necessary. |
@Ranguna issues are open if we intend to do something (or want others to do something). If we kept every issue open despite not having any idea how to address it, openness would not be a communicative aspect of an issue. |
@RyanCavanaugh so we just ignore issues that we don't know how to fix? Does that mean that typescript has other bugs that are intentionally ignored? That's a little sad. This feels like we are avoiding problems. Openness is just to let people know that a problem exists, fixing the problem is another thing. Issue open = there's a problem. |
@Ranguna that's not the definition we've chosen to use |
It looks like the definition you've chosen is to ignore the problems you can't/don't want to solve. |
TypeScript Version: 3.7.2 (and latest nightly)
Search Terms:
autocomplete on keyof without any
no autocomplete when extending keyof generic without any
Code
Expected behavior:
result
should have autocomplete with the following members:v1
andv2
.Actual behavior:
result
doesn't have any autocomplete. If interface C is replaced with:Everything works as expected but the type of
o[number][string]
is lost toany
insidefun
.Playground Link: https://www.typescriptlang.org/play/index.html#code/JYOwLgpgTgZghgYwgAgMLIN4FgBQz-IDaA1hAJ4BcyAzmFKAOYC6Vt9IDuAvrrjAK4gEYYAHsQyASAA8AFWQQAHpBAATamkJMAfAApRVWQEoqGIqTLJQyC6JjJZhEPwC2AI2hMWyZ++jIubDwCUUIABiZCACIopgA6bl4cABsIMGQoCGp+ZPSAXklBXUIggmQANwBGKijKqO4AGkxcMvKAJhq2+pwuJiMAbiTM7NyEnCA
Related Issued: Maybe #27928
The text was updated successfully, but these errors were encountered: