Commit 104b5c84 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Fix a bug when parsing multiple arrows of function interfaces.

parent 70043fc7
Pipeline #159 failed with stages
in 36 seconds
......@@ -724,9 +724,9 @@ let_binding:
b = branches {
let pre_intf = (x, y) :: other_arrows in
let intf = List.map (fun (x, y) ->
(x, List.fold_right (fun e acc ->
(x, let y = List.rev y in List.fold_left (fun acc e ->
let loc = Cduce_loc.(merge_loc e.loc acc.loc) in
Cduce_loc.mk_loc loc (Arrow (e,acc)))(List.tl y) (List.hd y))
Cduce_loc.mk_loc loc (Arrow (e,acc))) (List.hd y)(List.tl y))
) pre_intf
in
(intf, b)
......
......@@ -1222,8 +1222,11 @@ and type_check' loc env e constr precise =
let t =
if Types.subtype a.fun_typ constr then a.fun_typ
else
should_have loc constr
"but the interface of the abstraction is not compatible"
should_have loc constr (Format.asprintf
"but the interface (%a) of the abstraction is not compatible with type
(%a)"
Types.Print.print a.fun_typ
Types.Print.print constr)
in
let env =
match a.fun_name with
......
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