Browse Source

Include headers required by switches on generic EnumValue.

Hugh 10 years ago
parent
commit
eff03d9f49
1 changed files with 2 additions and 9 deletions
  1. 2 9
      gencpp.ml

+ 2 - 9
gencpp.ml

@@ -1079,15 +1079,6 @@ let contains_break expression =
 let dynamic_internal = function | "__Is" -> true | _ -> false
 
 
-(* Get a list of variables to extract from a enum tmatch *)
-let tmatch_params_to_args params =
-   (match params with
-   | None | Some [] -> []
-   | Some l ->
-      let n = ref (-1) in
-      List.fold_left
-         (fun acc v -> incr n; match v with None -> acc | Some v -> (v.v_name,v.v_type,!n) :: acc) [] l)
-
 let rec is_null expr =
    match expr.eexpr with
    | TConst TNull -> true
@@ -2709,6 +2700,8 @@ let find_referenced_types ctx obj super_deps constructor_deps header_only for_de
             (* Must visit type too, Type.iter will visit the expressions ... *)
             | TVar (v,_) ->
                visit_type v.v_type
+            (* Must visit enum type too, Type.iter will visit the expressions ... *)
+            | TEnumParameter (_,ef,_) -> visit_type (follow ef.ef_type)
             (* Must visit args too, Type.iter will visit the expressions ... *)
             | TFunction func_def ->
                List.iter (fun (v,_) -> visit_type v.v_type) func_def.tf_args;