You can add const check: Record<keyof A, true> = {x: true, y: true}; to make it:
const check: Record<keyof A, true> = {x: true, y: true};
function areEqual(one: A, another: A): boolean { const check: Record<keyof A, true> = {x: true, y: true}; return one.x === another.x && one.y === another.y; }