Skip to content

Commit

Permalink
Fix structure/record inference
Browse files Browse the repository at this point in the history
The original code simply used a wrong variable in place of the field name.
  • Loading branch information
polytypic committed Feb 19, 2020
1 parent d146ee9 commit 2046638
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion elab.ml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ Trace.debug (lazy ("[FunE] env =" ^ VarSet.fold (fun a s -> s ^ " " ^ a) (domain
| InferT(z) ->
(* TODO: row polymorphism *)
let t, zs = guess_typ (Env.domain_typ (add_typs aks env)) BaseK in
let tr = [l, t] in
let tr = [var.it, t] in
resolve_always z (StrT(tr)); tr, zs
| _ -> error exp1.at "expression is not a structure"
in
Expand Down
4 changes: 4 additions & 0 deletions regression.1ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
record_inference x = x.works_a_little;

;;

type DEC_PUNNING = {int; list};

;;
Expand Down

0 comments on commit 2046638

Please sign in to comment.