// @strict: true // @declaration: true type A = { a: string }; type B = { b: string }; type T01 = keyof (A & B); // "a" | "b" type T02 = keyof (T & B); // "b" | keyof T type T03 = keyof (A & U); // "a" | keyof U type T04 = keyof (T & U); // keyof T | keyof U type T05 = T02; // "a" | "b" type T06 = T03; // "a" | "b" type T07 = T04; // "a" | "b" // Repros from #22291 type Example1 = keyof (Record & Record); type Result1 = Example1<'x', 'y'>; // "x" | "y" type Result2 = keyof (Record<'x', any> & Record<'y', any>); // "x" | "y" type Example3 = keyof (Record); type Result3 = Example3<'x' | 'y'>; // "x" | "y" type Example4 = (Record & Record); type Result4 = keyof Example4<'x', 'y'>; // "x" | "y" type Example5 = keyof (T & U); type Result5 = Example5, Record<'y', any>>; // "x" | "y"