mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[typer] Type Array.at returnType as PolyType
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import invariant from "invariant";
|
||||
import { Effect } from "./HIR";
|
||||
import { BuiltInType, FunctionType, PrimitiveType } from "./Types";
|
||||
import { BuiltInType, FunctionType, PolyType, PrimitiveType } from "./Types";
|
||||
|
||||
const PRIMITIVE_TYPE: PrimitiveType = {
|
||||
kind: "Primitive",
|
||||
@@ -58,7 +58,7 @@ function addShape(
|
||||
export type FunctionSignature = {
|
||||
positionalParams: Array<Effect>;
|
||||
restParam: Effect | null;
|
||||
returnType: BuiltInType | null;
|
||||
returnType: BuiltInType | PolyType;
|
||||
calleeEffect: Effect;
|
||||
};
|
||||
|
||||
@@ -85,7 +85,7 @@ addShape(BUILTIN_SHAPES, ArrayShapeId, [
|
||||
addFunction(BUILTIN_SHAPES, [], {
|
||||
positionalParams: [Effect.Read],
|
||||
restParam: null,
|
||||
returnType: null,
|
||||
returnType: { kind: "Poly" },
|
||||
calleeEffect: Effect.Read,
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Hook } from "./Hooks";
|
||||
|
||||
export type BuiltInType = PrimitiveType | FunctionType | ObjectType;
|
||||
|
||||
export type Type = BuiltInType | HookType | PhiType | PolyType | TypeVar;
|
||||
export type Type = BuiltInType | HookType | PhiType | TypeVar | PolyType;
|
||||
export type PrimitiveType = { kind: "Primitive" };
|
||||
export type HookType = {
|
||||
kind: "Hook";
|
||||
|
||||
Reference in New Issue
Block a user