Skip to content

Commit

Permalink
It looks like pattern types need to be generalized at the same level …
Browse files Browse the repository at this point in the history
…as the current execution. Fixes: #2773
  • Loading branch information
toots committed Dec 8, 2022
1 parent da5b8cf commit 753f9f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lang/typechecking.ml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ let rec check ?(print_toplevel = false) ~throw ~level ~(env : Typing.env) e =
(* Printf.printf "generalize at %d: %B\n\n!" level (value_restriction def); *)
if value_restriction def then fst (generalize ~level def.t) else []
in
let penv, pa = type_of_pat ~level:(level + 1) ~pos pat in
let penv, pa = type_of_pat ~level ~pos pat in
def.t <: pa;
let penv =
List.map
Expand Down

0 comments on commit 753f9f7

Please sign in to comment.