Commits

Anonymous committed fad5e00

PR#5744: fix pb with virtual attributes

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12952f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

  • Participants
  • Parent commits a3886be

Comments (0)

Files changed (1)

File ocamldoc/odoc_ast.ml

         | { cf_desc = Typedtree.Tcf_val (_, _, _, ident, Tcfk_concrete exp, _) } :: q
           when Name.from_ident ident = name ->
             exp.Typedtree.exp_type
+        | { cf_desc = Typedtree.Tcf_val (_, _, _, ident, Tcfk_virtual typ, _) } :: q
+          when Name.from_ident ident = name ->
+            typ.Typedtree.ctyp_type
         | _ :: q ->
             iter q
       in
       in
       fun ct_decl -> iter ct_decl.Types.clty_type
 
-    let search_virtual_attribute_type table ctname name =
-      let ct_decl = search_class_type_declaration table ctname in
-      let cls_sig = class_sig_of_cltype_decl ct_decl.ci_type_decl in
-      let (_,_,texp) = Types.Vars.find name cls_sig.cty_vars in
-      texp
-
    let search_method_expression cls name =
       let rec iter = function
         | [] ->
             let complete_name = Name.concat current_class_name label in
             let (info_opt, ele_comments) = get_comments_in_class last_pos loc.Location.loc_start.Lexing.pos_cnum in
             let type_exp =
-            try
-              if virt then
-                Typedtree_search.search_virtual_attribute_type table
-                (Name.simple current_class_name) label
-              else
-                Typedtree_search.search_attribute_type tt_cls label
+            try Typedtree_search.search_attribute_type tt_cls label
             with Not_found ->
                 raise (Failure (Odoc_messages.attribute_not_found_in_typedtree complete_name))
           in