What is the difference between these two pieces of code below? Why are they not the same? I understand that the types of both b.a and c.a should be number.
interface A {
a: any
}
type B = A & {a: number}
const b = {} as unknown as B;
b.a;
interface A {
a: any
}
interface C extends A {
a: number
}
const c = {} as unknown as C;
c.a;
Is there a misunderstanding on my part? The AI’s response aligns with my understanding, which is that both should be of type number.
I used ChatGPT, but it didn’t help me solve the problem. My TypeScript version is 4.9.5.