[types] Check the shapeId as part of the object type equals check
Sathya Gunasekaran committed
Feb 8, 2024 at 16:19 UTC
3c431f9afe4e48d31801fbfdadf3b4be55ebd5a9
1 file changed
+5
-1
compiler/packages/babel-plugin-react-forget/src/HIR/Types.ts
+5
-1
@@ -171,7 +171,11 @@ function polyTypeEquals(tA: Type, tB: Type): boolean {
171
}
172
173
function objectTypeEquals(tA: Type, tB: Type): boolean {
174
- return typeKindCheck(tA, tB, "Object");
174
+ if (tA.kind === "Object" && tB.kind == "Object") {
175
+ return tA.shapeId === tB.shapeId;
176
+ }
177
+
178
+ return false;
179
}
180
181
function funcTypeEquals(tA: Type, tB: Type): boolean {