mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user