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
@RyanCavanaugh - could this be addressed in strict-mode?
In strict mode, not all JS is a valid TS (e.g. no implicit any), therefore this presents an opportunity to discourage const foo = {'42': 'foo'}; const bar = foo[42] in favour of stricter typings.
Alternatively I would be interested in in other approaches or workarounds given that assigning an array to what is expected to be an object could have significant issues at run-time.
TypeScript Version: 2.4.0
Code
Expected behavior:
The code above doesn't compile.
Actual behavior:
Typescript silently accepts such code.
The text was updated successfully, but these errors were encountered: