const foo = (x: Partial<{ a: A; b: B }>) => x as B; const y = foo({ a: 'potato', b: 2, });