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
{{ message }}
Repository navigation
Unexpected excess property error with intersection of index signaturesΒ #51875
letx: {[k: string]: {a: 0}}&{[k: string]: {b: 0}};x={y: {a: 0,b: 0}}// error!// ~~~~ // Object literal may only specify known properties, // and 'b' does not exist in type '{ a: 0; }'x={y: {a: 0}}// error!// ~// Property 'b' is missing in type '{ a: 0; }'
π Actual behavior
The object literal { a: 0, b: 0 } is considered to have an excess property of b, but if you remove b then the compiler will complain that b is missing. It's a catch-22!
π Expected behavior
The object literal { a:0, b: 0 } should be accepted.
Activity
fatcerberus commentedon Dec 13, 2022
Nice.