|TypeScript 3.2 Gets Stricter Checking|
|Written by Ian Elliot|
|Friday, 30 November 2018|
There's a new version of TypeScript that has tightened up type-checking for methods on functions, and added a way to handle spreads of existing objects into new objects.
One of the changes to this new version is stricter checking for bind, call and apply. These are methods on functions, and until now TypeScript hasn't been able to model the functions. Bind, call and apply were therefore designed to take any number of arguments and to return any. ES2015’s arrow functions and rest/spread arguments have made it easier to express what some of the methods do, but the developers of TypeScript have reworked the implementation so that it uses modeling parameter lists with tuple types, and that TypeScript's uses of bind, call and apply can be more strictly checked if you choose to use a new flag called strictBindCallApply.
In view of all this, TypeScript 3.2 now permits object spreads on generics and models them using intersections.
Other improvements in this release include configuration inheritance via
or email your comment to: email@example.com
|Last Updated ( Friday, 30 November 2018 )|