-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Mapped types over keyof T should be subtypes of types with string index signatures #14548
Comments
I suppose if the source is a generic mapped type, and the target only has string indexer, then the two types are relatable iff the template type of the source is relatable to the type of the index signature of the target. |
So you're saying if we constrain the generic type in |
I am saying this is a new type compatibility rule we need to encode in the compiler. |
It would also be nice if the return type of |
The problem with that idea, @cwmacdon is that our "StrictDictionary" might actually be something that |
Is it in the nightly build yet? |
TypeScript Version: 2.2.1
Code
Expected behaviour:
No Compile error.
Actual behaviour:
Compile error:
Edit: Replace StrictDictionary with Record<t, string>. Show full compile error.
The text was updated successfully, but these errors were encountered: