[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.
This commit is contained in:
Sathya Gunasekaran
2024-03-28 12:32:25 +00:00
parent 0a3d1c3d31
commit fd3ae0ca0a
@@ -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,