Skip to content

Commit 58e6b04

Browse files
committed
fix(typecheck): infer Ref<T> kind as arity-1 ctor (#135 slice 10)
effects.affine externs (make_ref/get/set) use Ref<T>, an undeclared opaque type constructor from the `state` effect. infer_kind hardcodes known opaque ctors (Array/Option/List/Vec/Cmd arity-1, Result arity-2) and falls back to KType for the rest, so TApp(Ref,[T]) hit check_kind_app's 'Too many arguments for kind'. Ref is the direct analogue of Cmd (Stage-11 opaque effect ctor) — add it to the arity-1 list. effects.affine now compiles resolve->typecheck; 12/19 stdlib green, zero regression. Refs #128
1 parent ebec5c6 commit 58e6b04

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/typecheck.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ let rec infer_kind (ctx : context) (ty : ty) : kind result =
311311
end
312312
| TCon name ->
313313
begin match name with
314-
| "Array" | "Option" | "List" | "Vec" | "Cmd" -> Ok (KArrow (KType, KType))
314+
| "Array" | "Option" | "List" | "Vec" | "Cmd" | "Ref" -> Ok (KArrow (KType, KType))
315315
| "Result" -> Ok (KArrow (KType, KArrow (KType, KType)))
316316
| _ -> Ok KType
317317
end

0 commit comments

Comments
 (0)