From 3c431f9afe4e48d31801fbfdadf3b4be55ebd5a9 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Thu, 8 Feb 2024 16:19:55 +0000 Subject: [PATCH] [types] Check the shapeId as part of the object type equals check --- .../packages/babel-plugin-react-forget/src/HIR/Types.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/Types.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/Types.ts index 176f91e447..0aa61913bd 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/Types.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/Types.ts @@ -171,7 +171,11 @@ function polyTypeEquals(tA: Type, tB: Type): boolean { } function objectTypeEquals(tA: Type, tB: Type): boolean { - return typeKindCheck(tA, tB, "Object"); + if (tA.kind === "Object" && tB.kind == "Object") { + return tA.shapeId === tB.shapeId; + } + + return false; } function funcTypeEquals(tA: Type, tB: Type): boolean {