Sfoglia il codice sorgente

[cpp] Include headers for classes that have instance functions called. Closes #5026

Hugh 9 anni fa
parent
commit
5f25fffe5e
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      src/generators/gencpp.ml

+ 8 - 0
src/generators/gencpp.ml

@@ -3755,6 +3755,14 @@ let find_referenced_types_flags ctx obj super_deps constructor_deps header_only
             (* 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;
+
+            | TField( obj, field ) ->
+               (match field with
+               | FInstance (clazz,params,_)
+               | FClosure (Some (clazz,params),_) ->
+                   visit_type (TInst (clazz,params))
+               | _ -> ()
+               )
             | TConst TSuper ->
                (match follow expression.etype with
                | TInst (klass,params) ->