Commit 82c9f052 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Check that patterns do not contain type variables.

parent 699bf667
......@@ -704,6 +704,10 @@ and branches env b =
cur_branch := [];
let ploc = p.loc in
let p = pat env p in
let () =
let t = Types.descr (Patterns.accept p) in
if not (Types.no_var t) then error ploc "Type variables cannot occur in patterns"
let fvp = Patterns.fv p in
let (fv2,e) = expr (enter_values_dummy fvp env) noloc e in
let br_loc = merge_loc ploc e.Typed.exp_loc in
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment