Anonymous avatar Anonymous committed fad5e00

PR#5744: fix pb with virtual attributes

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

Comments (0)

Files changed (1)

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.