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
Search Terms: object literal parameter inference destructuring default value
Code
constfn1=(options: {headers?: {}})=>{};// No error as expectedfn1({headers: {foo: 1}});constfn2=({ headers ={}})=>{};// Unexpected error: Property 'foo' does not exist on type '{}'.fn2({headers: {foo: 1}});
The text was updated successfully, but these errors were encountered:
This is an issue exposed by #19513. We're not properly widening types in types implied by object destructuring patterns. Looks like a fairly simple fix.
TypeScript Version: 2.7.2
Search Terms: object literal parameter inference destructuring default value
Code
The text was updated successfully, but these errors were encountered: