From 23d40e40cf1a4bb3ba624dd353617256470101d2 Mon Sep 17 00:00:00 2001 From: Yuki Oshima Date: Sat, 30 Nov 2024 15:03:38 +0900 Subject: [PATCH] eval_Var_bug fixed --- lib/eval.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/eval.ml b/lib/eval.ml index 6ab129b..3f58701 100644 --- a/lib/eval.ml +++ b/lib/eval.ml @@ -59,7 +59,11 @@ let rec eval ?(debug=false) (env: (tyvar list * value) Environment.t) f = let xs, v = Environment.find x env in let us = List.map nu_to_fresh us in begin match v with - | FunV proc -> FunV (fun _ -> proc (xs, us)) + | FunV proc -> FunV ( + fun (xs', us') -> + let us = List.map (subst_type (Utils.List.zip xs' us')) us in + proc (xs, us) + ) | _ -> v end | IConst (_, i) -> IntV i