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
empty has no index signature. computed has an index signature {[x: number]: number}.
There's no implicitAny error on the element access computed[key].
Actual behavior:
None of the object literals has an index signature. This causes the element access computed[key] to have an implicitAny error.
Note that this is not an error in a TS file.
Related Issues:
This is caused by @weswigham's PR #25996. I agree with not adding an implicit string index signature to every JS object literal. But not adding one where it makes sense just loses type information.
The text was updated successfully, but these errors were encountered:
Hm. We must have been disabling this in JS in favor of the fake index signature. Shouldn't be too difficult to fix - should just be a removal of a condition in checkObjectLiteral. Thanks for the report!
TypeScript Version: 3.1.0-dev.20180803
Search Terms:
Code
Expected behavior:
empty
has no index signature.computed
has an index signature{[x: number]: number}
.There's no implicitAny error on the element access
computed[key]
.Actual behavior:
None of the object literals has an index signature. This causes the element access
computed[key]
to have an implicitAny error.Note that this is not an error in a TS file.
Related Issues:
This is caused by @weswigham's PR #25996. I agree with not adding an implicit string index signature to every JS object literal. But not adding one where it makes sense just loses type information.
The text was updated successfully, but these errors were encountered: