Commits

camlspotter committed c8bb3b4

variant/record constructor

  • Participants
  • Parent commits f94b747

Comments (0)

Files changed (3)

     typ_manifest: core_type option;
     typ_variance: (bool * bool) list;
     typ_loc: Location.t }
+*)
 
-and type_kind =
-    Ttype_abstract
-  | Ttype_variant of (Ident.t * string loc * core_type list * Location.t) list
-  | Ttype_record of
-      (Ident.t * string loc * mutable_flag * core_type * Location.t) list
+      method! type_kind tk = 
+        begin match tk with 
+        | Ttype_abstract -> ()
+        | Ttype_variant lst -> 
+            List.iter (fun (id, {loc}, _, _loc(*?*)) ->
+              record loc (Str (AStr_type id))) lst
+        | Ttype_record lst ->
+            List.iter (fun (id, {loc}, _, _, _loc(*?*)) ->
+              record loc (Str (AStr_type id))) lst
+        end;
+        super#type_kind tk
+
+(*
 
 and exception_declaration =
   { exn_params : core_type list;

tests/Makefile.targets

 use_record.cmo \
 utf8.cmo \
 variant.cmo \
+variant_constructor.cmo \
 variant_external.cmo \
 with_type.cmo \
 with_type2.cmo \
 *)
 
 let _ = 
-  let module G = 
-    (* module G => *)
+  let module (* module G => *) G (* <= module G *) = 
     struct let (* G.x => *) x (* <= G.x *) = 1 end 
-    (* <= module G *)  
+
   in
   let module H = G (* ? module G *) in
   G.x (* ? G.x *) + H.x (* ? G.x *)