camlspotter avatar camlspotter committed 41fa54a

imported fix 44af6d9c64a6 from custom

Comments (0)

Files changed (7)

ocamlspot/spotapi.ml

     | Mod_abstract -> fprintf ppf "<abst>"
     | Mod_unpack mty -> 
         fprintf ppf "@[unpack@ : @[%a@]@]"
-          (Printtyp.modtype ~with_pos:true) mty
+          format_module_expr mty
 
   and format_structure ppf items = 
     fprintf ppf "{ @[<v>%a@] }"

ocamlspot/spotapi.mli

       | Mod_functor of Ident.t * Types.module_type * module_expr
       | Mod_apply of module_expr * module_expr
       | Mod_constraint of module_expr * Types.module_type
-      | Mod_unpack of Types.module_type
+      | Mod_unpack of module_expr
       | Mod_abstract
 
   and structure = structure_item list

ocamlspot/spoteval.ml

         let v1 = module_expr env None mexp1 in
         let v2 = module_expr env None mexp2 in
 	apply v1 v2
-    | Mod_unpack _mty -> lazy (Error (Failure "packed"))
+    | Mod_unpack mty -> module_expr env None mty
 
   (* expand internal Include and get alist by Ident.t *)
   (* the list order is REVERSED and is last-defined-first, 

ocamlspot/tests/Makefile.targets

 external.cmo \
 external_include.cmo \
 fstclassmodule.cmo \
+fstclassmodule2.cmo \
 functor.cmo \
 functor_parameter.cmo \
 immediate_include.cmo \

ocamlspot/tests/fstclassmodule2.ml

-module type ASig = sig
-  val f : int -> int
-end
-
-module A = struct
-  let f x = x + 1
-end
-
+module type ASig = sig (* B.f => *) val f : int -> int (* <= B.f *) end
+module A = struct let f x = x + 1 end
 let x = (module A : ASig)
-
-let y =
+let y = 
   let module B = (val x : ASig) in
-  B.f 1
+  B.f (* ? B.f *) 1
     | Mod_functor of Ident.t * Types.module_type * module_expr (* module M(I:S) = *)
     | Mod_apply of module_expr * module_expr (* module M = N(O) *)
     | Mod_constraint of module_expr * Types.module_type
-    | Mod_unpack of Types.module_type
+    | Mod_unpack of module_expr
     | Mod_abstract (* used for Tmodtype_abstract *)
 
   (* structure abstraction : name - defloc asoc list *)
 	Mod_apply (module_expr mexp1, module_expr mexp2)
     | Tmod_constraint (mexp, mty, _mcoercion) ->
 	Mod_constraint (module_expr mexp, mty)
-    | Tmod_unpack (_expr, mty) -> Mod_unpack mty
+    | Tmod_unpack (_expr, mty) -> Mod_unpack (module_type mty)
 
   and structure_item sitem = 
     (* it may recompute the same thing, but it is cheap *)
     | Mod_functor of Ident.t * Types.module_type * module_expr (* module M(I:S) = *)
     | Mod_apply of module_expr * module_expr (* module M = N(O) *)
     | Mod_constraint of module_expr * Types.module_type
-    | Mod_unpack of Types.module_type
+    | Mod_unpack of module_expr
     | Mod_abstract (* used for Tmodtype_abstract *)
 
   (* structure abstraction : name - defloc asoc list *)
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.