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
We observed for one project a new type error from trying to compare a string with an array after an Array.isArray check. The generics involved make a minimal reproduction infeasible but the essence of the code is:
if(Array.isArray(foo)){If(foo!=="something")// raises a new error for some complex foo}
Exports are hoisted to the top of a module
Module exports seem to be hoisted to the top of modules now. No runtime impact observed.
My educated guess is that the observed change was caused by the work done in #57946 and #57549
Improved narrowing of Array.isArray result
I don't think type predicate inference could change this anyhow. That change focuses on inferring some functions as type predicates. Array.isArray was already a type predicate - it's declaration is defined in a lib file.
Activity
Andarist commentedon May 13, 2024
My educated guess is that the observed change was caused by the work done in #57946 and #57549
I don't think type predicate inference could change this anyhow. That change focuses on inferring some functions as type predicates.
Array.isArraywas already a type predicate - it's declaration is defined in a lib file.