You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related, but this feels more definitely buggy than #27273 because of the : Acc annotation on the object literal... index signatures are weird and will always have some unexpected behaviors, but it seems like this is probably fixable, in the specific case where we have an object literal and a contextual type.
Hm, this could be fixed without fixing #27273 but it feels to me that perhaps some solution for #27273 is actually desirable and that would potentially fix this case here as well.
I don't feel confident enough in implementing a special handling for this case here. It probably could be done by consulting the contextual type after this call. At the very least It would have to be checked if:
the result is missing the required index info
and if the "sources" (left and right types) had the required index info
Bug Report
π Search Terms
spread computed property number reduce
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
If we change the type of the computed property
id
fromnumber
tostring
, it works as expected (we get an error).Alternatively, if we remove the spread of
acc
it works as expected:My workaround for now is to convert the type before it's used as a computed property:
π Actual behavior
See code comments above.
π Expected behavior
See code comments above.
The text was updated successfully, but these errors were encountered: