-
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
Generic template literal index does not resolve value type #50030
Comments
Thanks @weswigham !! |
@zachkirsch FYI, the "fix" for this will get reverted: #57202 |
It's not clear to me this is an issue we want to fix. In the issue example, every property is of type In mapped types where the template type actually depends on the iteration type, such as type Foo<T extends string> = {
[K in T as `_${K}`]: K;
} to understand the constraint of |
Re-labeling as suggestion and un-assigning myself. |
Bug Report
π Search Terms
template string key generic "is not assignable to type"
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
In the generic function
genericTest
, indexing into the object doesn't yield a value with the typetrue
.π Expected behavior
In the generic function
genericTest
, indexing into the object should yield a value with the typetrue
.Related issues
This seems similar to #48983, but that was marked as
Working as intended
and the behavior in this example doesn't seem like it should be intended.The text was updated successfully, but these errors were encountered: