this repo has no description

Remove core types from Identifiers

Instead, put them into (unresolved) path types.

authored by

Paul-Elliot and committed by jon.recoil.org 19a32ccd 1a634e21

+168 -303
+2
src/document/generator.ml
··· 106 106 match path with 107 107 | `Identifier (id, _) -> 108 108 unresolved [ inline @@ Text (Identifier.name id) ] 109 + | `CoreType n -> 110 + O.elt [ inline @@ Text (Odoc_model.Names.TypeName.to_string n) ] 109 111 | `Substituted m -> from_path (m :> Path.t) 110 112 | `SubstitutedMT m -> from_path (m :> Path.t) 111 113 | `SubstitutedT m -> from_path (m :> Path.t)
+9 -9
src/document/url.ml
··· 61 61 | `SubstitutedMT m -> render_path (m :> Path.t) 62 62 | `SubstitutedT m -> render_path (m :> Path.t) 63 63 | `SubstitutedCT m -> render_path (m :> Path.t) 64 + | `CoreType n -> TypeName.to_string n 64 65 in 65 66 66 67 render_path ··· 272 273 _constructor_ identifiers. *) 273 274 let suffix_for_constructor x = x 274 275 275 - let rec from_identifier : Identifier.t -> (t, Error.t) result = 276 - let open Error in 277 - function 276 + let rec from_identifier : Identifier.t -> (t, Error.t) result = function 278 277 | { iv = `Module (parent, mod_name); _ } -> 279 278 let parent = Path.from_identifier (parent :> Path.any) in 280 279 let kind = `Module in ··· 309 308 (TypeName.to_string type_name); 310 309 kind; 311 310 } 312 - | { iv = `CoreType ty_name; _ } -> 313 - Error (Not_linkable ("core_type:" ^ TypeName.to_string ty_name)) 314 311 | { iv = `Extension (parent, name); _ } -> 315 312 let page = Path.from_identifier (parent :> Path.any) in 316 313 let kind = `Extension in ··· 382 379 happen, [`Type] may not happen either but just in case, use the 383 380 grand-parent. *) 384 381 match parent with 385 - | { iv = `CoreType _; _ } -> 386 - Error (Unexpected_anchor "core_type label parent") 387 382 | { iv = `Type (gp, _); _ } -> Ok (mk ~kind:`Section gp str_name) 388 383 | { iv = #Path.nonsrc_pv; _ } as p -> 389 384 Ok (mk ~kind:`Section (p :> Path.any) str_name)) ··· 406 401 let polymorphic_variant ~type_ident elt = 407 402 let name_of_type_constr te = 408 403 match te with 409 - | Odoc_model.Lang.TypeExpr.Constr (path, _) -> 410 - render_path (path :> Odoc_model.Paths.Path.t) 404 + | Odoc_model.Lang.TypeExpr.Constr 405 + ((#Odoc_model.Paths.Path.NonCoreType.t as path), _) -> 406 + render_path 407 + (path 408 + : Odoc_model.Paths.Path.NonCoreType.t 409 + :> Odoc_model.Paths.Path.t) 410 + | Odoc_model.Lang.TypeExpr.Constr (`CoreType n, _) -> TypeName.to_string n 411 411 | _ -> 412 412 invalid_arg 413 413 "DocOckHtml.Url.Polymorphic_variant_decl.name_of_type_constr"
+4 -2
src/index/entry.ml
··· 2 2 open Odoc_model.Paths 3 3 4 4 type type_decl_entry = { 5 - canonical : Path.Type.t option; 5 + canonical : Path.NonCoreType.t option; 6 6 equation : TypeDecl.Equation.t; 7 7 representation : TypeDecl.Representation.t option; 8 8 } ··· 172 172 | Exception exc -> 173 173 let res = 174 174 match exc.res with 175 - | None -> TypeExpr.Constr (Odoc_model.Predefined.exn_path, []) 175 + | None -> 176 + TypeExpr.Constr 177 + (`CoreType (Odoc_model.Names.TypeName.make_std "exn"), []) 176 178 | Some x -> x 177 179 in 178 180 let kind = Exception { args = exc.args; res } in
+1 -1
src/index/entry.mli
··· 2 2 open Odoc_model.Paths 3 3 4 4 type type_decl_entry = { 5 - canonical : Path.Type.t option; 5 + canonical : Path.NonCoreType.t option; 6 6 equation : TypeDecl.Equation.t; 7 7 representation : TypeDecl.Representation.t option; 8 8 }
+1 -5
src/loader/cmi.ml
··· 1052 1052 if Env.is_shadowed env id 1053 1053 then 1054 1054 let identifier = Env.find_type_identifier env id in 1055 - let name = 1056 - match identifier.iv with 1057 - | `CoreType n 1058 - | `Type (_, n) -> n 1059 - in 1055 + let `Type (_, name) = identifier.iv in 1060 1056 { shadowed with s_types = (Ident.name id, name) :: shadowed.s_types } 1061 1057 else shadowed 1062 1058 in
+1 -1
src/loader/doc_attr.ml
··· 266 266 | `Dot (parent, name) -> `Dot (conv_canonical_module parent, Names.ModuleName.make_std name) 267 267 | `Root name -> `Root (Names.ModuleName.make_std name) 268 268 269 - let conv_canonical_type : Odoc_model.Reference.path -> Paths.Path.Type.t option = function 269 + let conv_canonical_type : Odoc_model.Reference.path -> Paths.Path.NonCoreType.t option = function 270 270 | `Dot (parent, name) -> Some (`DotT (conv_canonical_module parent, Names.TypeName.make_std name)) 271 271 | _ -> None 272 272
+2 -1
src/loader/doc_attr.mli
··· 72 72 val read_location : Location.t -> Odoc_model.Location_.span 73 73 74 74 val conv_canonical_module : Odoc_model.Reference.path -> Paths.Path.Module.t 75 - val conv_canonical_type : Odoc_model.Reference.path -> Paths.Path.Type.t option 75 + val conv_canonical_type : 76 + Odoc_model.Reference.path -> Paths.Path.NonCoreType.t option 76 77 val conv_canonical_module_type : 77 78 Odoc_model.Reference.path -> Paths.Path.ModuleType.t option
+7 -10
src/loader/ident_env.cppo.ml
··· 20 20 module Id = Paths.Identifier 21 21 module P = Paths.Path 22 22 23 - type type_ident = Paths.Identifier.Path.Type.t 24 - 25 23 module LocHashtbl = Hashtbl.Make(struct 26 24 type t = Location.t 27 25 let equal l1 l2 = l1 = l2 ··· 644 642 let find_value_identifier env id = 645 643 Ident.find_same id env.values 646 644 647 - (** Lookup a type in the environment. If it isn't found, it's assumed to be a 648 - core type. *) 645 + (** Lookup a type in the environment. If it isn't found, it means it's a core 646 + type. *) 649 647 let find_type env id = 650 - try (Ident.find_same id env.types :> Id.Path.Type.t) 648 + try Some (Ident.find_same id env.types :> Id.Path.Type.t) 651 649 with Not_found -> ( 652 - try (Ident.find_same id env.classes :> Id.Path.Type.t) 650 + try Some (Ident.find_same id env.classes :> Id.Path.Type.t) 653 651 with Not_found -> ( 654 - try (Ident.find_same id env.class_types :> Id.Path.Type.t) 655 - with Not_found -> 656 - (Paths.Identifier.Mk.core_type (Ident.name id) :> type_ident))) 652 + try Some (Ident.find_same id env.class_types :> Id.Path.Type.t) 653 + with Not_found -> None)) 657 654 658 655 let find_class_type env id = 659 656 try ··· 684 681 with Not_found -> assert false 685 682 686 683 let read_type_ident env id = 687 - `Identifier (find_type env id, false) 684 + match find_type env id with Some id -> `Identifier (id , false) | None -> `CoreType (TypeName.of_ident id) 688 685 689 686 let read_value_ident env id : Paths.Path.Value.t = 690 687 `Identifier (find_value_identifier env id, false)
+1 -1
src/loader/ident_env.cppo.mli
··· 55 55 56 56 val find_value_identifier : t -> Ident.t -> Paths.Identifier.Value.t 57 57 58 - val find_type : t -> Ident.t -> Paths.Identifier.Path.Type.t 58 + val find_type : t -> Ident.t -> Paths.Identifier.Path.Type.t option 59 59 60 60 val find_constructor_identifier : t -> Ident.t -> Paths.Identifier.Constructor.t 61 61
-1
src/loader/implementation.ml
··· 223 223 continue anchor parent 224 224 | `Page _ -> assert false 225 225 | `LeafPage _ -> assert false 226 - | `CoreType _ -> assert false 227 226 | `SourceLocation _ -> assert false 228 227 | `ClassType (parent, name) -> 229 228 let anchor = anchor `ClassType (TypeName.to_string name) in
+1 -1
src/model/lang.ml
··· 253 253 id : Identifier.Type.t; 254 254 source_loc : Identifier.SourceLocation.t option; 255 255 doc : Comment.docs; 256 - canonical : Path.Type.t option; 256 + canonical : Path.NonCoreType.t option; 257 257 equation : Equation.t; 258 258 representation : Representation.t option; 259 259 }
-1
src/model/odoc_model.ml
··· 2 2 module Comment = Comment 3 3 module Paths = Paths 4 4 module Names = Names 5 - module Predefined = Predefined 6 5 module Root = Root 7 6 module Error = Error 8 7 module Location_ = Location_
+5 -4
src/model/paths.ml
··· 39 39 | `Result x -> name_aux (x :> t) 40 40 | `ModuleType (_, name) -> ModuleTypeName.to_string name 41 41 | `Type (_, name) -> TypeName.to_string name 42 - | `CoreType name -> TypeName.to_string name 43 42 | `Constructor (_, name) -> ConstructorName.to_string name 44 43 | `Field (_, name) -> FieldName.to_string name 45 44 | `Extension (_, name) -> ExtensionName.to_string name ··· 70 69 | `Result x -> is_hidden (x :> t) 71 70 | `ModuleType (_, name) -> ModuleTypeName.is_hidden name 72 71 | `Type (_, name) -> TypeName.is_hidden name 73 - | `CoreType name -> TypeName.is_hidden name 74 72 | `Constructor (parent, _) -> is_hidden (parent :> t) 75 73 | `Field (parent, _) -> is_hidden (parent :> t) 76 74 | `Extension (parent, _) -> is_hidden (parent :> t) ··· 107 105 ModuleTypeName.to_string name :: full_name_aux (parent :> t) 108 106 | `Type (parent, name) -> 109 107 TypeName.to_string name :: full_name_aux (parent :> t) 110 - | `CoreType name -> [ TypeName.to_string name ] 111 108 | `Constructor (parent, name) -> 112 109 ConstructorName.to_string name :: full_name_aux (parent :> t) 113 110 | `Field (parent, name) -> ··· 149 146 fun (n : non_src) -> 150 147 match n with 151 148 | { iv = `Result i; _ } -> label_parent_aux (i :> non_src) 152 - | { iv = `CoreType _; _ } -> assert false 153 149 | { iv = `Root _; _ } as p -> (p :> label_parent) 154 150 | { iv = `Page _; _ } as p -> (p :> label_parent) 155 151 | { iv = `LeafPage _; _ } as p -> (p :> label_parent) ··· 689 685 and is_path_hidden : Paths_types.Path.any -> bool = 690 686 let open Paths_types.Path in 691 687 function 688 + | `CoreType _ -> false 692 689 | `Resolved r -> is_resolved_hidden ~weak_canonical_test:false r 693 690 | `Identifier (_, hidden) -> hidden 694 691 | `Substituted r -> is_path_hidden (r :> any) ··· 815 812 816 813 module ModuleType = struct 817 814 type t = Paths_types.Path.module_type 815 + end 816 + 817 + module NonCoreType = struct 818 + type t = Paths_types.Path.non_core_type 818 819 end 819 820 820 821 module Type = struct
+4
src/model/paths.mli
··· 408 408 type t = Paths_types.Path.type_ 409 409 end 410 410 411 + module NonCoreType : sig 412 + type t = Paths_types.Path.non_core_type 413 + end 414 + 411 415 module Value : sig 412 416 type t = Paths_types.Path.value 413 417 end
+10 -7
src/model/paths_types.ml
··· 77 77 and class_signature = class_signature_pv id 78 78 (** @canonical Odoc_model.Paths.Identifier.ClassSignature.t *) 79 79 80 - type datatype_pv = 81 - [ `Type of signature * TypeName.t | `CoreType of TypeName.t ] 80 + type datatype_pv = [ `Type of signature * TypeName.t ] 82 81 (** @canonical Odoc_model.Paths.Identifier.DataType.t_pv *) 83 82 84 83 and datatype = datatype_pv id ··· 132 131 and module_type = module_type_pv id 133 132 (** @canonical Odoc_model.Paths.Identifier.ModuleType.t *) 134 133 135 - type type_pv = [ `Type of signature * TypeName.t | `CoreType of TypeName.t ] 134 + type type_pv = [ `Type of signature * TypeName.t ] 136 135 (** @canonical Odoc_model.Paths.Identifier.Type.t_pv *) 137 136 138 137 and type_ = type_pv id ··· 327 326 | `DotMT of module_ * ModuleTypeName.t ] 328 327 (** @canonical Odoc_model.Paths.Path.ModuleType.t *) 329 328 330 - type type_ = 329 + type non_core_type = 331 330 [ `Resolved of Resolved_path.type_ 332 - | `SubstitutedT of type_ 331 + | `SubstitutedT of non_core_type 333 332 | `Identifier of Identifier.path_type * bool 334 333 | `DotT of module_ * TypeName.t ] 334 + (** @canonical Odoc_model.Paths.Path.NonCoreType.t *) 335 + 336 + type type_ = [ non_core_type | `CoreType of TypeName.t ] 335 337 (** @canonical Odoc_model.Paths.Path.Type.t *) 336 338 337 339 type value = ··· 349 351 350 352 type any = 351 353 [ `Resolved of Resolved_path.any 352 - | `SubstitutedT of type_ 354 + | `SubstitutedT of non_core_type 353 355 | `SubstitutedMT of module_type 356 + | `CoreType of TypeName.t 354 357 | `Substituted of module_ 355 358 | `SubstitutedCT of class_type 356 359 | `Identifier of Identifier.path_any * bool ··· 402 405 [ `Identifier of Identifier.path_type 403 406 | `SubstitutedT of type_ 404 407 | `SubstitutedCT of class_type 405 - | `CanonicalType of type_ * Path.type_ 408 + | `CanonicalType of type_ * Path.non_core_type 406 409 | `Type of module_ * TypeName.t 407 410 | `Class of module_ * TypeName.t 408 411 | `ClassType of module_ * TypeName.t ]
-148
src/model/predefined.ml
··· 1 - (* 2 - * Copyright (c) 2014 Leo White <lpw25@cl.cam.ac.uk> 3 - * 4 - * Permission to use, copy, modify, and distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 - *) 16 - 17 - open Lang 18 - open Names 19 - 20 - let predefined_location = 21 - let point = { Location_.line = 1; column = 0 } in 22 - { Location_.file = "predefined"; start = point; end_ = point } 23 - 24 - let empty_doc = [] 25 - 26 - let mk_equation params = 27 - let open TypeDecl.Equation in 28 - { params; private_ = false; manifest = None; constraints = [] } 29 - 30 - let nullary_equation = mk_equation [] 31 - let covariant_equation = 32 - mk_equation [ { desc = Var "'a"; variance = Some Pos; injectivity = true } ] 33 - let invariant_equation = 34 - mk_equation [ { desc = Var "'a"; variance = None; injectivity = true } ] 35 - 36 - let source_loc = None 37 - 38 - let mk_type ?(doc = empty_doc) ?(eq = nullary_equation) ?repr id = 39 - let canonical = None in 40 - { 41 - TypeDecl.id; 42 - source_loc; 43 - doc; 44 - canonical; 45 - equation = eq; 46 - representation = repr; 47 - } 48 - 49 - let mk_constr ?(args = TypeDecl.Constructor.Tuple []) id = 50 - { TypeDecl.Constructor.id; doc = empty_doc; args; res = None } 51 - 52 - module Mk = Paths.Identifier.Mk 53 - 54 - let bool_identifier = Mk.core_type "bool" 55 - let unit_identifier = Mk.core_type "unit" 56 - let exn_identifier = Mk.core_type "exn" 57 - let list_identifier = Mk.core_type "list" 58 - let option_identifier = Mk.core_type "option" 59 - 60 - let false_identifier = 61 - Mk.constructor (bool_identifier, ConstructorName.make_std "false") 62 - 63 - let true_identifier = 64 - Mk.constructor (bool_identifier, ConstructorName.make_std "true") 65 - 66 - let void_identifier = 67 - Mk.constructor (unit_identifier, ConstructorName.make_std "()") 68 - 69 - let nil_identifier = 70 - Mk.constructor (list_identifier, ConstructorName.make_std "([])") 71 - 72 - let cons_identifier = 73 - Mk.constructor (list_identifier, ConstructorName.make_std "(::)") 74 - 75 - let none_identifier = 76 - Mk.constructor (option_identifier, ConstructorName.make_std "None") 77 - 78 - let some_identifier = 79 - Mk.constructor (option_identifier, ConstructorName.make_std "Some") 80 - 81 - let exn_path = `Resolved (`Identifier exn_identifier) 82 - let list_path = `Resolved (`Identifier list_identifier) 83 - 84 - let false_decl = mk_constr ~args:(Tuple []) false_identifier 85 - let true_decl = mk_constr ~args:(Tuple []) true_identifier 86 - let void_decl = mk_constr ~args:(Tuple []) void_identifier 87 - let nil_decl = mk_constr ~args:(Tuple []) nil_identifier 88 - 89 - let cons_decl = 90 - let head = TypeExpr.Var "'a" in 91 - let tail = TypeExpr.(Constr (list_path, [ head ])) in 92 - mk_constr ~args:(Tuple [ head; tail ]) cons_identifier 93 - 94 - let none_decl = mk_constr ~args:(Tuple []) none_identifier 95 - let some_decl = mk_constr ~args:(Tuple [ TypeExpr.Var "'a" ]) some_identifier 96 - 97 - (** The type representation for known core types. *) 98 - let type_repr_of_core_type = 99 - let open TypeDecl.Representation in 100 - function 101 - | "bool" -> Some (Variant [ false_decl; true_decl ]) 102 - | "unit" -> Some (Variant [ void_decl ]) 103 - | "exn" -> Some Extensible 104 - | "option" -> Some (Variant [ none_decl; some_decl ]) 105 - | "list" -> Some (Variant [ nil_decl; cons_decl ]) 106 - | _ -> None 107 - 108 - let type_eq_of_core_type = function 109 - | "lazy_t" | "extension_constructor" -> Some covariant_equation 110 - | "array" -> Some invariant_equation 111 - | _ -> None 112 - 113 - let doc_of_core_type = 114 - let elt x = Location_.at predefined_location x in 115 - let words ss = 116 - ss 117 - |> List.rev_map (fun s -> [ elt `Space; elt (`Word s) ]) 118 - |> List.flatten |> List.tl |> List.rev 119 - in 120 - let paragraph x = elt (`Paragraph x) in 121 - function 122 - | "floatarray" -> 123 - Some 124 - [ 125 - paragraph 126 - (words [ "This"; "type"; "is"; "used"; "to"; "implement"; "the" ] 127 - @ [ 128 - elt `Space; 129 - elt 130 - (`Reference 131 - ( `Module 132 - ( `Root ("Array", `TModule), 133 - ModuleName.make_std "Floatarray" ), 134 - [] )); 135 - elt `Space; 136 - ] 137 - @ words 138 - [ "module."; "It"; "should"; "not"; "be"; "used"; "directly." ] 139 - ); 140 - ] 141 - | _ -> None 142 - 143 - let type_of_core_type name = 144 - let identifier = Mk.core_type name 145 - and repr = type_repr_of_core_type name 146 - and eq = type_eq_of_core_type name 147 - and doc = doc_of_core_type name in 148 - mk_type ?doc ?repr ?eq identifier
-22
src/model/predefined.mli
··· 1 - (* 2 - * Copyright (c) 2014 Leo White <lpw25@cl.cam.ac.uk> 3 - * 4 - * Permission to use, copy, modify, and distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 - *) 16 - 17 - open Paths 18 - 19 - val exn_path : Path.Type.t 20 - 21 - val type_of_core_type : string -> Lang.TypeDecl.t 22 - (** The type declaration of a core type given its name. *)
+2 -2
src/model_desc/paths_desc.ml
··· 119 119 ( "`Type", 120 120 ((parent :> id_t), name), 121 121 Pair (identifier, Names.typename) ) 122 - | `CoreType name -> C ("`CoreType", name, Names.typename) 123 122 | `Constructor (parent, name) -> 124 123 C 125 124 ( "`Constructor", ··· 227 226 | `Substituted m -> C ("`Substituted", (m :> p), path) 228 227 | `SubstitutedMT m -> C ("`SubstitutedMT", (m :> p), path) 229 228 | `SubstitutedT m -> C ("`SubstitutedT", (m :> p), path) 230 - | `SubstitutedCT m -> C ("`SubstitutedCT", (m :> p), path)) 229 + | `SubstitutedCT m -> C ("`SubstitutedCT", (m :> p), path) 230 + | `CoreType n -> C ("`CoreType", n, Names.typename)) 231 231 232 232 and resolved_path : rp t = 233 233 Variant
+3 -4
src/occurrences/table.ml
··· 40 40 | `Field (parent, _) -> do_ parent 41 41 | `Extension (parent, _) -> do_ parent 42 42 | `Type (parent, _) -> do_ parent 43 - | `CoreType _ -> incr tbl id 44 43 | `Constructor (parent, _) -> do_ parent 45 44 | `Exception (parent, _) -> do_ parent 46 45 | `ExtensionDecl (parent, _, _) -> do_ parent ··· 78 77 | `Value (parent, _) -> do_ parent 79 78 | `ClassType (parent, _) -> do_ parent 80 79 | `Root _ -> ( try Some (H.find t id) with Not_found -> None) 81 - | `SourcePage _ | `Page _ | `LeafPage _ | `CoreType _ | `SourceLocation _ 82 - | `Label _ | `SourceLocationMod _ | `Result _ | `AssetFile _ 83 - | `SourceLocationInternal _ -> 80 + | `SourcePage _ | `Page _ | `LeafPage _ | `SourceLocation _ | `Label _ 81 + | `SourceLocationMod _ | `Result _ | `AssetFile _ | `SourceLocationInternal _ 82 + -> 84 83 None 85 84 86 85 let get t id =
-1
src/search/json_index/json_search.ml
··· 51 51 ret "ModuleType" (ModuleTypeName.to_string name) :: of_id (parent :> t) 52 52 | `Type (parent, name) -> 53 53 ret "Type" (TypeName.to_string name) :: of_id (parent :> t) 54 - | `CoreType name -> [ ret "CoreType" (TypeName.to_string name) ] 55 54 | `Constructor (parent, name) -> 56 55 ret "Constructor" (ConstructorName.to_string name) :: of_id (parent :> t) 57 56 | `Field (parent, name) ->
+13 -8
src/xref2/compile.ml
··· 15 15 fun env p -> 16 16 match p with 17 17 | `Resolved _ -> p 18 - | _ -> ( 19 - let cp = Component.Of_Lang.(type_path (empty ()) p) in 18 + | `CoreType _ as x -> x 19 + | #Paths.Path.NonCoreType.t as p -> ( 20 + let cp = Component.Of_Lang.(non_core_type_path (empty ()) p) in 20 21 match Tools.resolve_type_path env cp with 21 22 | Ok p' -> `Resolved Lang_of.(Path.resolved_type (empty ()) p') 22 23 | Error _ -> p) ··· 740 741 fun env t -> 741 742 let open TypeDecl in 742 743 let container = 743 - match t.id.iv with 744 - | `Type (parent, _) -> (parent :> Id.LabelParent.t) 745 - | `CoreType _ -> assert false 744 + match t.id.iv with `Type (parent, _) -> (parent :> Id.LabelParent.t) 746 745 in 747 746 let equation = type_decl_equation env container t.equation in 748 747 let representation = ··· 865 864 | Arrow (lbl, t1, t2) -> 866 865 Arrow (lbl, type_expression env parent t1, type_expression env parent t2) 867 866 | Tuple ts -> Tuple (List.map (type_expression env parent) ts) 868 - | Constr (path, ts') -> ( 869 - let cp = Component.Of_Lang.(type_path (empty ()) path) in 867 + | Constr ((`CoreType _ as x), ts) -> 868 + let ts = List.map (type_expression env parent) ts in 869 + Constr (x, ts) 870 + | Constr ((#Odoc_model.Paths.Path.NonCoreType.t as path), ts') -> ( 871 + let cp = Component.Of_Lang.(non_core_type_path (empty ()) path) in 870 872 let ts = List.map (type_expression env parent) ts' in 871 873 match Tools.resolve_type env cp with 872 874 | Ok (cp, (`FType _ | `FClass _ | `FClassType _)) -> ··· 875 877 | Ok (_cp, `FType_removed (_, x, _eq)) -> 876 878 (* Substitute type variables ? *) 877 879 Lang_of.(type_expr (empty ()) parent x) 878 - | Error _e -> Constr (Lang_of.(Path.type_ (empty ()) cp), ts)) 880 + | Error _e -> 881 + Constr 882 + ( (Lang_of.(Path.non_core_type (empty ()) cp) :> Paths.Path.Type.t), 883 + ts )) 879 884 | Polymorphic_variant v -> 880 885 Polymorphic_variant (type_expression_polyvar env parent v) 881 886 | Object o -> Object (type_expression_object env parent o)
+23 -7
src/xref2/component.ml
··· 270 270 type t = { 271 271 source_loc : Odoc_model.Paths.Identifier.SourceLocation.t option; 272 272 doc : CComment.docs; 273 - canonical : Odoc_model.Paths.Path.Type.t option; 273 + canonical : Odoc_model.Paths.Path.NonCoreType.t option; 274 274 equation : Equation.t; 275 275 representation : Representation.t option; 276 276 } ··· 429 429 | `Renamed of Ident.module_type ] 430 430 431 431 type subst_type = 432 - [ `Prefixed of Cpath.type_ * Cpath.Resolved.type_ | `Renamed of Ident.type_ ] 432 + [ `Prefixed of Cpath.non_core_type * Cpath.Resolved.type_ 433 + | `Renamed of Ident.type_ ] 433 434 434 435 type subst_class_type = 435 436 [ `Prefixed of Cpath.class_type * Cpath.Resolved.class_type ··· 665 666 | `Result parent -> 666 667 if c.short_paths then model_identifier c ppf (parent :> id) 667 668 else Format.fprintf ppf "%a.result" (model_identifier c) (parent :> id) 668 - | `CoreType name -> Format.fprintf ppf "%s" (TypeName.to_string name) 669 669 | `Constructor (ty, x) -> 670 670 Format.fprintf ppf "%a.%s" (model_identifier c) 671 671 (ty :> id) ··· 1253 1253 else Format.fprintf ppf ">>%a<<" (resolved_module_type_path c) m 1254 1254 | `FragmentRoot -> Format.fprintf ppf "FragmentRoot" 1255 1255 1256 - and type_path : config -> Format.formatter -> Cpath.type_ -> unit = 1256 + and non_core_type_path : 1257 + config -> Format.formatter -> Cpath.non_core_type -> unit = 1257 1258 fun c ppf p -> 1258 1259 match p with 1259 1260 | `Resolved r -> wrap c "resolved" resolved_type_path ppf r 1260 1261 | `Identifier (id, b) -> 1261 1262 wrap2 c "identifier" model_identifier bool ppf (id :> id) b 1262 1263 | `Local (id, b) -> wrap2 c "local" ident_fmt bool ppf id b 1263 - | `Substituted s -> wrap c "substituted" type_path ppf s 1264 + | `Substituted s -> wrap c "substituted" non_core_type_path ppf s 1264 1265 | `DotT (m, s) -> 1265 1266 Format.fprintf ppf "%a.%a" (module_path c) m TypeName.fmt s 1266 1267 | `Class (p, t) -> ··· 1273 1274 Format.fprintf ppf "%a.%s" (resolved_parent_path c) p 1274 1275 (TypeName.to_string t) 1275 1276 1277 + and type_path : config -> Format.formatter -> Cpath.type_ -> unit = 1278 + fun c ppf p -> 1279 + match p with 1280 + | `CoreType x -> Format.fprintf ppf "%s" (TypeName.to_string x) 1281 + | #Cpath.non_core_type as x -> non_core_type_path c ppf x 1282 + 1276 1283 and value_path : config -> Format.formatter -> Cpath.value -> unit = 1277 1284 fun c ppf p -> 1278 1285 match p with ··· 1325 1332 in 1326 1333 1327 1334 match p with 1335 + | `CoreType n -> Format.fprintf ppf "%s" (TypeName.to_string n) 1328 1336 | `Resolved rp -> wrap c "resolved" model_resolved_path ppf rp 1329 1337 | `Identifier (id, b) -> 1330 1338 wrap2 c "identifier" model_identifier bool ppf (id :> id) b ··· 2020 2028 | `Local i -> `Local (i, b)) 2021 2029 | `DotMT (path', x) -> `DotMT (module_path ident_map path', x) 2022 2030 2023 - and type_path : _ -> Odoc_model.Paths.Path.Type.t -> Cpath.type_ = 2031 + and non_core_type_path : 2032 + _ -> Odoc_model.Paths.Path.NonCoreType.t -> Cpath.non_core_type = 2024 2033 fun ident_map p -> 2025 2034 match p with 2026 2035 | `Resolved r -> `Resolved (resolved_type_path ident_map r) 2027 - | `SubstitutedT t -> `Substituted (type_path ident_map t) 2036 + | `SubstitutedT t -> `Substituted (non_core_type_path ident_map t) 2028 2037 | `Identifier (i, b) -> ( 2029 2038 match identifier Maps.Path.Type.find ident_map.path_types i with 2030 2039 | `Identifier i -> `Identifier (i, b) 2031 2040 | `Local i -> `Local (i, b)) 2032 2041 | `DotT (path', x) -> `DotT (module_path ident_map path', x) 2042 + 2043 + and type_path : _ -> Odoc_model.Paths.Path.Type.t -> Cpath.type_ = 2044 + fun ident_map p -> 2045 + match p with 2046 + | `CoreType x -> `CoreType x 2047 + | #Odoc_model.Paths.Path.NonCoreType.t as x -> 2048 + (non_core_type_path ident_map x :> Cpath.type_) 2033 2049 2034 2050 and value_path : _ -> Odoc_model.Paths.Path.Value.t -> Cpath.value = 2035 2051 fun ident_map p ->
+5 -3
src/xref2/component.mli
··· 259 259 type t = { 260 260 source_loc : Odoc_model.Paths.Identifier.SourceLocation.t option; 261 261 doc : CComment.docs; 262 - canonical : Odoc_model.Paths.Path.Type.t option; 262 + canonical : Odoc_model.Paths.Path.NonCoreType.t option; 263 263 equation : Equation.t; 264 264 representation : Representation.t option; 265 265 } ··· 407 407 | `Renamed of Ident.module_type ] 408 408 409 409 type subst_type = 410 - [ `Prefixed of Cpath.type_ * Cpath.Resolved.type_ | `Renamed of Ident.type_ ] 410 + [ `Prefixed of Cpath.non_core_type * Cpath.Resolved.type_ 411 + | `Renamed of Ident.type_ ] 411 412 412 413 type subst_class_type = 413 414 [ `Prefixed of Cpath.class_type * Cpath.Resolved.class_type ··· 688 689 val module_type_path : 689 690 map -> Odoc_model.Paths.Path.ModuleType.t -> Cpath.module_type 690 691 691 - val type_path : map -> Odoc_model.Paths.Path.Type.t -> Cpath.type_ 692 + val non_core_type_path : 693 + map -> Odoc_model.Paths.Path.NonCoreType.t -> Cpath.non_core_type 692 694 693 695 val value_path : map -> Odoc_model.Paths.Path.Value.t -> Cpath.value 694 696
+10 -7
src/xref2/cpath.ml
··· 31 31 [ `Local of Ident.type_ 32 32 | `Gpath of Path.Resolved.Type.t 33 33 | `Substituted of type_ 34 - | `CanonicalType of type_ * Path.Type.t 34 + | `CanonicalType of type_ * Path.NonCoreType.t 35 35 | `Type of parent * TypeName.t 36 36 | `Class of parent * TypeName.t 37 37 | `ClassType of parent * TypeName.t ] ··· 68 68 | `DotMT of module_ * ModuleTypeName.t 69 69 | `ModuleType of Resolved.parent * ModuleTypeName.t ] 70 70 71 - and type_ = 71 + and non_core_type = 72 72 [ `Resolved of Resolved.type_ 73 - | `Substituted of type_ 73 + | `Substituted of non_core_type 74 74 | `Local of Ident.type_ * bool 75 75 | `Identifier of Odoc_model.Paths.Identifier.Path.Type.t * bool 76 76 | `DotT of module_ * TypeName.t 77 77 | `Type of Resolved.parent * TypeName.t 78 78 | `Class of Resolved.parent * TypeName.t 79 79 | `ClassType of Resolved.parent * TypeName.t ] 80 + 81 + type type_ = [ `CoreType of TypeName.t | non_core_type ] 80 82 81 83 and value = 82 84 [ `Resolved of Resolved.value ··· 156 158 | `ModuleType (a, _) -> is_resolved_parent_substituted a 157 159 158 160 let is_type_substituted : type_ -> bool = function 161 + | `CoreType _ -> false 159 162 | `Resolved a -> is_resolved_type_substituted a 160 163 | `Identifier _ -> false 161 164 | `Local _ -> false ··· 244 247 | `Identifier ({ iv = `Type (_, t); _ }, b) -> b || TypeName.is_hidden t 245 248 | `Identifier ({ iv = `ClassType (_, t); _ }, b) -> b || TypeName.is_hidden t 246 249 | `Identifier ({ iv = `Class (_, t); _ }, b) -> b || TypeName.is_hidden t 247 - | `Identifier ({ iv = `CoreType _; _ }, b) -> b 248 250 | `Local (_, b) -> b 249 - | `Substituted p -> is_type_hidden p 251 + | `Substituted p -> is_type_hidden (p :> type_) 252 + | `CoreType _ -> false 250 253 | `DotT (p, _) -> is_module_hidden p 251 254 | `Type (p, _) | `Class (p, _) | `ClassType (p, _) -> 252 255 is_resolved_parent_hidden ~weak_canonical_test:false p ··· 361 364 | `Module m -> unresolve_resolved_module_path m 362 365 | `FragmentRoot | `ModuleType _ -> assert false 363 366 364 - and unresolve_resolved_type_path : Resolved.type_ -> type_ = function 367 + and unresolve_resolved_type_path : Resolved.type_ -> non_core_type = function 365 368 | (`Gpath _ | `Local _) as p -> `Resolved p 366 369 | `Substituted x -> unresolve_resolved_type_path x 367 370 | `CanonicalType (t1, _) -> unresolve_resolved_type_path t1 ··· 381 384 | y -> y 382 385 383 386 and unresolve_type_path : type_ -> type_ = function 384 - | `Resolved m -> unresolve_resolved_type_path m 387 + | `Resolved m -> (unresolve_resolved_type_path m :> type_) 385 388 | y -> y 386 389 387 390 and unresolve_class_type_path : class_type -> class_type = function
+1 -3
src/xref2/ident.ml
··· 68 68 let type_ : Type.t -> type_ = 69 69 fun t -> 70 70 let i = fresh_int () in 71 - match t.iv with 72 - | `Type (_, n) -> `LType (n, i) 73 - | `CoreType _n -> failwith "Bad" 71 + match t.iv with `Type (_, n) -> `LType (n, i) 74 72 75 73 let module_ : Module.t -> module_ = function 76 74 | { iv = `Module (_, n) | `Root (_, n); _ } ->
+13 -4
src/xref2/lang_of.ml
··· 97 97 | `ModuleType (`Module p, n) -> `DotMT (`Resolved (resolved_module map p), n) 98 98 | `ModuleType (_, _) -> failwith "Probably shouldn't happen" 99 99 100 - and type_ map (p : Cpath.type_) : Odoc_model.Paths.Path.Type.t = 100 + and non_core_type map (p : Cpath.non_core_type) : 101 + Odoc_model.Paths.Path.NonCoreType.t = 101 102 match p with 102 - | `Substituted x -> `SubstitutedT (type_ map x) 103 + | `Substituted x -> `SubstitutedT (non_core_type map x) 103 104 | `Identifier 104 105 (({ iv = #Odoc_model.Paths.Identifier.Path.Type.t_pv; _ } as y), b) -> 105 106 `Identifier (y, b) ··· 110 111 | `Class (`Module p, n) -> `DotT (`Resolved (resolved_module map p), n) 111 112 | `ClassType (`Module p, n) -> `DotT (`Resolved (resolved_module map p), n) 112 113 | `Type _ | `Class _ | `ClassType _ -> failwith "Probably shouldn't happen" 114 + 115 + and type_ map (p : Cpath.type_) : Odoc_model.Paths.Path.Type.t = 116 + match p with 117 + | `CoreType x -> `CoreType x 118 + | #Cpath.non_core_type as v -> 119 + (non_core_type map v :> Odoc_model.Paths.Path.Type.t) 113 120 114 121 and class_type map (p : Cpath.class_type) : Odoc_model.Paths.Path.ClassType.t 115 122 = ··· 695 702 let open Component.Extension in 696 703 { 697 704 parent; 698 - type_path = Path.type_ map t.type_path; 705 + type_path = (Path.type_ map t.type_path :> Paths.Path.Type.t); 699 706 doc = docs (parent :> Identifier.LabelParent.t) t.doc; 700 707 type_params = t.type_params; 701 708 private_ = t.private_; ··· 991 998 Arrow (lbl, type_expr map parent t1, type_expr map parent t2) 992 999 | Tuple ts -> Tuple (List.map (type_expr map parent) ts) 993 1000 | Constr (path, ts) -> 994 - Constr (Path.type_ map path, List.map (type_expr map parent) ts) 1001 + Constr 1002 + ( (Path.type_ map path :> Paths.Path.Type.t), 1003 + List.map (type_expr map parent) ts ) 995 1004 | Polymorphic_variant v -> 996 1005 Polymorphic_variant (type_expr_polyvar map parent v) 997 1006 | Object o -> Object (type_expr_object map parent o)
+1 -1
src/xref2/lang_of.mli
··· 16 16 17 17 val module_type : maps -> Cpath.module_type -> Path.ModuleType.t 18 18 19 - val type_ : maps -> Cpath.type_ -> Path.Type.t 19 + val non_core_type : maps -> Cpath.non_core_type -> Path.NonCoreType.t 20 20 21 21 val class_type : maps -> Cpath.class_type -> Path.ClassType.t 22 22
+20 -14
src/xref2/link.ml
··· 130 130 fun env p -> 131 131 if not (should_resolve (p :> Paths.Path.t)) then p 132 132 else 133 - let cp = Component.Of_Lang.(type_path (empty ()) p) in 134 - match cp with 135 - | `Resolved p -> 136 - let result = Tools.reresolve_type env p in 137 - `Resolved Lang_of.(Path.resolved_type (empty ()) result) 138 - | _ -> ( 139 - match Tools.resolve_type_path env cp with 140 - | Ok p' -> 141 - let result = Tools.reresolve_type env p' in 133 + match p with 134 + | `CoreType _ as x -> x 135 + | #Paths.Path.NonCoreType.t as p -> ( 136 + let cp = Component.Of_Lang.(non_core_type_path (empty ()) p) in 137 + match cp with 138 + | `Resolved p -> 139 + let result = Tools.reresolve_type env p in 142 140 `Resolved Lang_of.(Path.resolved_type (empty ()) result) 143 - | Error e -> 144 - Errors.report ~what:(`Type_path cp) ~tools_error:e `Lookup; 145 - p) 141 + | #Cpath.non_core_type as cp -> ( 142 + match Tools.resolve_type_path env cp with 143 + | Ok p' -> 144 + let result = Tools.reresolve_type env p' in 145 + `Resolved Lang_of.(Path.resolved_type (empty ()) result) 146 + | Error e -> 147 + Errors.report ~what:(`Type_path cp) ~tools_error:e `Lookup; 148 + p)) 146 149 147 150 let value_path : Env.t -> Paths.Path.Value.t -> Paths.Path.Value.t = 148 151 fun env p -> ··· 1044 1047 type_expression env parent visited t1, 1045 1048 type_expression env parent visited t2 ) 1046 1049 | Tuple ts -> Tuple (List.map (type_expression env parent visited) ts) 1047 - | Constr (path', ts') -> ( 1050 + | Constr ((`CoreType _ as x), ts) -> 1051 + let ts = List.map (type_expression env parent visited) ts in 1052 + Constr (x, ts) 1053 + | Constr ((#Paths.Path.NonCoreType.t as path'), ts') -> ( 1048 1054 let path = type_path env path' in 1049 1055 let ts = List.map (type_expression env parent visited) ts' in 1050 1056 if not (Paths.Path.is_hidden (path :> Paths.Path.t)) then Constr (path, ts) 1051 1057 else 1052 - let cp = Component.Of_Lang.(type_path (empty ()) path') in 1058 + let cp = Component.Of_Lang.(non_core_type_path (empty ()) path') in 1053 1059 match Tools.resolve_type env cp with 1054 1060 | Ok (cp', `FType (_, t)) -> 1055 1061 let cp' = Tools.reresolve_type env cp' in
+2 -1
src/xref2/shape_tools.cppo.ml
··· 48 48 | `Class (parent, name) -> proj parent Kind.Class (TypeName.to_string_unsafe name) 49 49 | `ClassType (parent, name) -> 50 50 proj parent Kind.Class_type (TypeName.to_string_unsafe name) 51 - | `Page _ | `LeafPage _ | `Label _ | `CoreType _ 51 + | `Page _ | `LeafPage _ | `Label _ 52 52 | `Constructor _ | `Field _ | `Method _ | `InstanceVariable _ | `Parameter _ 53 53 -> 54 54 (* Not represented in shapes. *) ··· 105 105 | `SubstitutedCT t -> shape_of_kind_path env kind (t :> Odoc_model.Paths.Path.t) 106 106 | `Identifier (id, _) -> shape_of_id env (id :> Odoc_model.Paths.Identifier.NonSrc.t) 107 107 | `Substituted t -> shape_of_kind_path env kind (t :> Odoc_model.Paths.Path.t) 108 + | `CoreType _ 108 109 | `Forward _ 109 110 | `Dot _ 110 111 | `Root _
+16 -6
src/xref2/subst.ml
··· 43 43 module_type = ModuleTypeMap.add id (`Prefixed (p, rp)) t.module_type; 44 44 } 45 45 46 - let add_type : Ident.type_ -> Cpath.type_ -> Cpath.Resolved.type_ -> t -> t = 46 + let add_type : 47 + Ident.type_ -> Cpath.non_core_type -> Cpath.Resolved.type_ -> t -> t = 47 48 fun id p rp t -> 48 49 { t with type_ = TypeMap.add (id :> Ident.type_) (`Prefixed (p, rp)) t.type_ } 49 50 ··· 55 56 type_ = 56 57 TypeMap.add 57 58 (id :> Ident.type_) 58 - (`Prefixed ((p :> Cpath.type_), (rp :> Cpath.Resolved.type_))) 59 + (`Prefixed ((p :> Cpath.non_core_type), (rp :> Cpath.Resolved.type_))) 59 60 t.type_; 60 61 class_type = 61 62 TypeMap.add (id :> Ident.type_) (`Prefixed (p, rp)) t.class_type; ··· 69 70 type_ = 70 71 TypeMap.add 71 72 (id :> Ident.type_) 72 - (`Prefixed ((p :> Cpath.type_), (rp :> Cpath.Resolved.type_))) 73 + (`Prefixed ((p :> Cpath.non_core_type), (rp :> Cpath.Resolved.type_))) 73 74 t.type_; 74 75 class_type = 75 76 TypeMap.add (id :> Ident.type_) (`Prefixed (p, rp)) t.class_type; ··· 333 334 | `ClassType (p, n) -> Not_replaced (`ClassType (resolved_parent_path s p, n)) 334 335 | `Class (p, n) -> Not_replaced (`Class (resolved_parent_path s p, n)) 335 336 336 - and type_path : t -> Cpath.type_ -> Cpath.type_ type_or_replaced = 337 + and non_core_type_path : 338 + t -> Cpath.non_core_type -> Cpath.non_core_type type_or_replaced = 337 339 fun s p -> 338 340 match p with 339 341 | `Resolved r -> ( 340 342 try resolved_type_path s r |> map_replaced (fun r -> `Resolved r) 341 343 with Invalidated -> 342 344 let path' = Cpath.unresolve_resolved_type_path r in 343 - type_path s path') 344 - | `Substituted p -> type_path s p |> map_replaced (fun r -> `Substituted r) 345 + non_core_type_path s path') 346 + | `Substituted p -> 347 + non_core_type_path s p |> map_replaced (fun r -> `Substituted r) 345 348 | `Local (id, b) -> ( 346 349 if TypeMap.mem id s.type_replacement then 347 350 Replaced (TypeMap.find id s.type_replacement) ··· 355 358 | `Type (p, n) -> Not_replaced (`Type (resolved_parent_path s p, n)) 356 359 | `Class (p, n) -> Not_replaced (`Class (resolved_parent_path s p, n)) 357 360 | `ClassType (p, n) -> Not_replaced (`ClassType (resolved_parent_path s p, n)) 361 + 362 + and type_path : t -> Cpath.type_ -> Cpath.type_ type_or_replaced = 363 + fun s p -> 364 + match p with 365 + | `CoreType x -> Not_replaced (`CoreType x) 366 + | #Cpath.non_core_type as x -> 367 + (non_core_type_path s x :> Cpath.type_ type_or_replaced) 358 368 359 369 and resolved_class_type_path : 360 370 t -> Cpath.Resolved.class_type -> Cpath.Resolved.class_type =
+2 -1
src/xref2/subst.mli
··· 15 15 val add_module_type : 16 16 Ident.module_type -> Cpath.module_type -> Cpath.Resolved.module_type -> t -> t 17 17 18 - val add_type : Ident.type_ -> Cpath.type_ -> Cpath.Resolved.type_ -> t -> t 18 + val add_type : 19 + Ident.type_ -> Cpath.non_core_type -> Cpath.Resolved.type_ -> t -> t 19 20 20 21 val add_class : 21 22 Ident.type_ -> Cpath.class_type -> Cpath.Resolved.class_type -> t -> t
+4 -14
src/xref2/tools.ml
··· 744 744 in 745 745 let res = 746 746 match p with 747 - | `Identifier { iv = `CoreType name; _ } -> 748 - (* CoreTypes aren't put into the environment, so they can't be handled 749 - by the next clause. They are already resolved. *) 750 - Ok 751 - (`FType 752 - ( name, 753 - Component.Of_Lang.( 754 - type_decl (empty ()) 755 - (Odoc_model.Predefined.type_of_core_type 756 - (TypeName.to_string name))) )) 757 747 | `Identifier ({ iv = `Type _; _ } as i) -> 758 748 of_option ~error:(`Lookup_failureT i) 759 749 (Env.(lookup_by_id s_datatype) i env) 760 - >>= fun (`Type ({ iv = `CoreType name | `Type (_, name); _ }, t)) -> 750 + >>= fun (`Type ({ iv = `Type (_, name); _ }, t)) -> 761 751 Ok (`FType (name, t)) 762 752 | `Identifier ({ iv = `Class _; _ } as i) -> 763 753 of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_class) i env) ··· 1008 998 |> map_error (fun e -> `Parent (`Parent_module_type e)) 1009 999 >>= fun (p, m) -> Ok (`Substituted p, m) 1010 1000 1011 - and resolve_type : Env.t -> Cpath.type_ -> resolve_type_result = 1001 + and resolve_type : Env.t -> Cpath.non_core_type -> resolve_type_result = 1012 1002 fun env p -> 1013 1003 let result = 1014 1004 match p with ··· 1416 1406 | Some (rp, _) -> `Resolved Lang_of.(Path.resolved_module_type (empty ()) rp) 1417 1407 1418 1408 and handle_canonical_type env p2 = 1419 - let cp2 = Component.Of_Lang.(type_path (empty ()) p2) in 1409 + let cp2 = Component.Of_Lang.(non_core_type_path (empty ()) p2) in 1420 1410 let lang_of cpath = 1421 1411 (Lang_of.(Path.resolved_type (empty ()) cpath) 1422 1412 :> Odoc_model.Paths.Path.Resolved.t) ··· 2310 2300 match e with 2311 2301 | Signature s -> Some s 2312 2302 | Constr (p, _) -> ( 2313 - match resolve_type env (p :> Cpath.type_) with 2303 + match resolve_type env (p :> Cpath.non_core_type) with 2314 2304 | Ok (_, `FClass (_, c)) -> class_signature_of_class env c 2315 2305 | Ok (_, `FClassType (_, c)) -> class_signature_of_class_type env c 2316 2306 | _ -> None)
+2 -2
src/xref2/tools.mli
··· 98 98 99 99 val resolve_type : 100 100 Env.t -> 101 - Cpath.type_ -> 101 + Cpath.non_core_type -> 102 102 ( Cpath.Resolved.type_ * Find.careful_type, 103 103 simple_type_lookup_error ) 104 104 Result.result ··· 140 140 141 141 val resolve_type_path : 142 142 Env.t -> 143 - Cpath.type_ -> 143 + Cpath.non_core_type -> 144 144 (Cpath.Resolved.type_, simple_type_lookup_error) Result.result 145 145 146 146 val resolve_value_path :
+1 -5
test/xref2/classes.t/run.t
··· 136 136 { 137 137 "Constr": [ 138 138 { 139 - "`Resolved": { 140 - "`Identifier": { 141 - "`CoreType": "unit" 142 - } 143 - } 139 + "`CoreType": "unit" 144 140 }, 145 141 [] 146 142 ]
+1 -5
test/xref2/deep_substitution.t/run.t
··· 46 46 "Some": { 47 47 "Constr": [ 48 48 { 49 - "`Resolved": { 50 - "`Identifier": { 51 - "`CoreType": "int" 52 - } 53 - } 49 + "`CoreType": "int" 54 50 }, 55 51 [] 56 52 ]
+1 -1
test/xref2/lib/common.cppo.ml
··· 598 598 | `DotT (parent,s) -> Format.fprintf ppf "%a.%a" path (parent :> Odoc_model.Paths.Path.t) TypeName.fmt s 599 599 | `DotV (parent,s) -> Format.fprintf ppf "%a.%a" path (parent :> Odoc_model.Paths.Path.t) ValueName.fmt s 600 600 | `Apply (func,arg) -> Format.fprintf ppf "%a(%a)" path (func :> Odoc_model.Paths.Path.t) path (arg :> Odoc_model.Paths.Path.t) 601 - | `SubstitutedT _|`SubstitutedMT _|`Substituted _|`SubstitutedCT _ -> Format.fprintf ppf "Unimplemented path" 601 + | `SubstitutedT _|`SubstitutedMT _|`Substituted _|`SubstitutedCT _ | `CoreType _ -> Format.fprintf ppf "Unimplemented path" 602 602 603 603 and model_fragment ppf (f : Odoc_model.Paths.Fragment.t) = 604 604 match f with