What is the reason why the code does not fail when executing a = b
? Check out this link
type A = {
x?: number
y?: number
}
type B = {
x?: number
z: number
}
let a: A = {}
let b: B = {z: 1}
a = b // does not fail
a = {z: 1} // fails