-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
keyof behavior in 2.9 #24574
Comments
My use case works with
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
TypeScript Version: 2.9
Code
Expected behavior:
b
should bestring
Actual behavior:
b
isstring | number
Maybe there is a simple fix to this but I cannot find anything. My temporary fix is to use
"keyofStringsOnly": true
.Playground Link:
http://www.typescriptlang.org/play/#src=export%20interface%20Dict%3CT%3E%20%7B%0D%0A%20%20%5Bkey%3A%20string%5D%3A%20T%3B%0D%0A%7D%0D%0A%0D%0Atype%20a%20%3D%20Dict%3Cboolean%3E%3B%0D%0A%0D%0Atype%20b%20%3D%20keyof%20a%3B
Related Issues:
#24560 may be the same but I cannot tell.
The text was updated successfully, but these errors were encountered: