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
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.
Bug Report
π Search Terms
index signature, intersection, excess property checking
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The object literal
{ a: 0, b: 0 }
is considered to have an excess property ofb
, but if you removeb
then the compiler will complain thatb
is missing. It's a catch-22!π Expected behavior
The object literal
{ a:0, b: 0 }
should be accepted.This came from this Stack Overflow question. Looks like it started with #49503.
The text was updated successfully, but these errors were encountered: