[typer] Type Array.at returnType as PolyType

This commit is contained in:
Sathya Gunasekaran
2023-03-27 15:58:07 +01:00
parent 67b2a9f314
commit a0fa5ede54
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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,
}),
],
+1 -1
View File
@@ -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";