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
P.S. It seems reasonable to align behavior with other empty array cases, e.g.:
letx={array: []// Object literal's property 'array' implicitly has an 'any[]' type}letx=[]x[0].toLowerCase()// Variable 'x' implicitly has type 'any[]' in some locations where its type cannot be determined
The text was updated successfully, but these errors were encountered:
TypeScript Version: 3.7-Beta, "noImplicitAny" compiler mode
Search Terms:
Array.prototype.reduce, reduce type inference, reduce implicit any
Code
Expected behavior:
result
implicitly has typeany[]
-> compiler error ("noImplicitAny")or
result
has typeunknown[]
-> compiler errorActual behavior:
result
has typeany[]
, no errorsPlayground Link: http://www.typescriptlang.org/play/?strictNullChecks=false&strictPropertyInitialization=false&ts=3.7-Beta&ssl=6&ssc=24&pln=1&pc=1#code/MYewdgzgLgBATgUwgVwDawLwwNoEYC6AdIgCbLAIAUlAhsMADQwCWUCAtgJQwYB8MAbwBQMUTDrBCAB2QQAFpVYdOIsYijI4YcfSEBfJtnwqhiFOmwAGIlBAAZEAHcEcAMI0IVTkA
Related Issues: #25454, #29604
P.S. It seems reasonable to align behavior with other empty array cases, e.g.:
The text was updated successfully, but these errors were encountered: