We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TypeScript Version: 2.2.0-dev.20161122
With --strictNullChecks.
--strictNullChecks
Code
function spread(arg?: {}): {} { return {...arg} } spread()
Expected behavior:
spread() returns empty object {}.
spread()
{}
Actual behavior:
Spread types may only be created from object types.
The spec specifically allows null and undefined spread arguments by having an early check before the ToObject abstract operation (3.1.2).
null
undefined
ToObject
TypeScript Version: 2.2.0-dev.20161122
With
--strictNullChecks.Code
Expected behavior:
spread()returns empty object{}.Actual behavior:
Spread types may only be created from object types.The spec specifically allows
nullandundefinedspread arguments by having an early check before theToObjectabstract operation (3.1.2).