From a0fa5ede549c76600734d2758f1617b7c8fb44aa Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Mon, 27 Mar 2023 15:58:07 +0100 Subject: [PATCH] [typer] Type Array.at returnType as PolyType --- compiler/forget/src/HIR/ObjectShape.ts | 6 +++--- compiler/forget/src/HIR/Types.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/forget/src/HIR/ObjectShape.ts b/compiler/forget/src/HIR/ObjectShape.ts index ff76ad0ae2..e5790bbe9a 100644 --- a/compiler/forget/src/HIR/ObjectShape.ts +++ b/compiler/forget/src/HIR/ObjectShape.ts @@ -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; 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, }), ], diff --git a/compiler/forget/src/HIR/Types.ts b/compiler/forget/src/HIR/Types.ts index 933ef3aa20..9e17dd086d 100644 --- a/compiler/forget/src/HIR/Types.ts +++ b/compiler/forget/src/HIR/Types.ts @@ -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";