make the dummy method disappear when finalizing a class
parent
e524660a68
commit
86e1c8a4e0
BIN
boot/ocamlc
BIN
boot/ocamlc
Binary file not shown.
BIN
boot/ocamldep
BIN
boot/ocamldep
Binary file not shown.
|
@ -3547,7 +3547,7 @@ let match_class_types ?(trace=true) env pat_sch subj_sch =
|
|||
| _ -> CM_Hide_public lab::err
|
||||
end
|
||||
in
|
||||
if Concr.mem lab sign1.csig_concr then err
|
||||
if lab = dummy_method || Concr.mem lab sign1.csig_concr then err
|
||||
else CM_Hide_virtual ("method", lab) :: err)
|
||||
miss1 []
|
||||
in
|
||||
|
|
|
@ -1572,6 +1572,21 @@ let final_decl env define_class
|
|||
raise(Error(cl.pci_loc, env, Non_collapsable_conjunction (id, clty, trace)))
|
||||
end;
|
||||
|
||||
(* make the dummy method disappear *)
|
||||
begin
|
||||
let self_type = Ctype.self_type clty.cty_type in
|
||||
let methods, _ =
|
||||
Ctype.flatten_fields
|
||||
(Ctype.object_fields (Ctype.expand_head env self_type))
|
||||
in
|
||||
List.iter (fun (lab,kind,_) ->
|
||||
if lab = dummy_method then
|
||||
match Btype.field_kind_repr kind with
|
||||
Fvar r -> Btype.set_kind r Fabsent
|
||||
| _ -> ()
|
||||
) methods
|
||||
end;
|
||||
|
||||
List.iter Ctype.generalize clty.cty_params;
|
||||
generalize_class_type true clty.cty_type;
|
||||
Misc.may Ctype.generalize clty.cty_new;
|
||||
|
|
Loading…
Reference in New Issue