An error is generated by the code snippet below, which is expected:
const x = { x: 1 }
const y: typeof x = { x: 2, y: 3 }
// Error: Type '{ x: number; y: number; }' is not assignable to type '{ x: number; }'.
However, no error is produced by this code block:
const x = { x: 1 }
const y = { x: 2, z: 3 }
const z: typeof x = y
What issue exists in the second code snippet? Can type checks be enforced there?