Open murtyjones opened 5 months ago
Stricter type-checking of partial objects
My educated guess is that the observed change was caused by the work done in https://github.com/microsoft/TypeScript/pull/57946 and https://github.com/microsoft/TypeScript/pull/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.
Acknowledgement
Comment
We are in the process of evaluating the impact of TS 5.5 beta on Bloomberg code. Below are preliminary findings.
Overall this looks to be a low-impact release. The following changes were observed and seem to either be benign in nature or else improvements:
Array.isArray
resultStricter type-checking of partial objects
We observed one project with a new type error in 5.5-beta, seemingly due to an improvement in type-checking for partials.
A minimal reproduction is here.
Improved narrowing of
Array.isArray
resultWe 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:
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.