From fd3ae0ca0a548df5e77b16bf993dd7cc4feb4fe3 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Thu, 28 Mar 2024 12:32:25 +0000 Subject: [PATCH] [type] Conservatively type return values from reanimated Typing them as mixed read only seems safe because the fields are primitives but lets be conservative and type as Poly. --- compiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts index 2679833c0b..605c362a02 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts @@ -9,7 +9,6 @@ import { Effect, ValueKind, ValueReason } from "./HIR"; import { BUILTIN_SHAPES, BuiltInArrayId, - BuiltInMixedReadonlyId, BuiltInUseEffectHookId, BuiltInUseInsertionEffectHookId, BuiltInUseLayoutEffectHookId, @@ -434,7 +433,7 @@ export function installReAnimatedTypes( addHook(registry, { positionalParams: [], restParam: Effect.Freeze, - returnType: { kind: "Object", shapeId: BuiltInMixedReadonlyId }, + returnType: { kind: "Poly" }, returnValueKind: ValueKind.Frozen, noAlias: true, calleeEffect: Effect.Read,