Commit baddf30b authored by Andrei Paskevich's avatar Andrei Paskevich

reference variables: three minor fixes

parent 3bf5f4b8
......@@ -672,6 +672,8 @@ let denv_pure denv get_dty =
let dity = if idx then dity_int else dity_of_dvty dvty in
let dt = Dterm.DTvar (n, fold dity) in
if dref = ([], true) then
let dt = Dterm.dterm Coercion.empty dt in
let dt = Dterm.DTattr (dt, Sattr.singleton Pmodule.ref_attr) in
let dt = Dterm.dterm Coercion.empty dt in
Dterm.DTapp (ls_ref_proj, [dt])
else dt in
......
......@@ -22,7 +22,8 @@
~desc:"When set, model attributes are not added during parsing"
"no_auto_model"
let add_attr id l = { id with id_ats = l }
let add_attr id l = (* id.id_ats is usually nil *)
{ id with id_ats = List.rev_append id.id_ats l }
let add_model_trace_attr id =
if Debug.test_flag debug_auto_model then id else
......
......@@ -230,8 +230,10 @@ let mk_closure crcmap loc ls =
let vs_dref vs = Sattr.mem Pmodule.ref_attr vs.vs_name.id_attrs
let to_deref = function
| DTvar _ -> true (* needed for DEpure *)
let rec to_deref = function
| DTattr ({dt_node = DTvar _}, attrs)
when Sattr.mem Pmodule.ref_attr attrs -> true (* needed for DEpure *)
| DTattr (dt,_) | DTuloc (dt,_) | DTcast (dt,_) -> to_deref dt.dt_node
| DTgvar vs -> vs_dref vs
| _ -> false
......
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