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: ...@@ -724,9 +724,9 @@ let_binding:
b = branches { b = branches {
let pre_intf = (x, y) :: other_arrows in let pre_intf = (x, y) :: other_arrows in
let intf = List.map (fun (x, y) -> 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 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 ) pre_intf
in in
(intf, b) (intf, b)
......
...@@ -1222,8 +1222,11 @@ and type_check' loc env e constr precise = ...@@ -1222,8 +1222,11 @@ and type_check' loc env e constr precise =
let t = let t =
if Types.subtype a.fun_typ constr then a.fun_typ if Types.subtype a.fun_typ constr then a.fun_typ
else else
should_have loc constr should_have loc constr (Format.asprintf
"but the interface of the abstraction is not compatible" "but the interface (%a) of the abstraction is not compatible with type
(%a)"
Types.Print.print a.fun_typ
Types.Print.print constr)
in in
let env = let env =
match a.fun_name with 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