Commit 578f1470 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Correctly set the file location on some generated intermediate Abstractions.

This allows the compiler to correctly locate error messages occuring in the typechecker.
parent 58d89d58
......@@ -521,6 +521,7 @@ EXTEND Gram
multi_prod nopos (List.map snd args),
multi_prod nopos (List.map fst args)
in
let body_loc = match body with LocatedExpr (loc, _) -> loc | _ -> lop _loc in
let (tres,body) =
List.fold_right
(fun args (tres,body) ->
......@@ -529,7 +530,7 @@ EXTEND Gram
{ fun_name = None; fun_iface = [targ,tres];
fun_body = [arg,body] } in
let t = mknoloc (Arrow (targ,tres)) in
(t,e)
(t,LocatedExpr(body_loc, e))
)
others (tres,body) in
let p1, targ1 =
......
let f (x : []) (y : []): Int =
x @ y
;;
\ No newline at end of file
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