Переглянути джерело

Follow types when calling super

Hugh Sanderson 14 роки тому
батько
коміт
a2927f4c69
1 змінених файлів з 8 додано та 0 видалено
  1. 8 0
      gencpp.ml

+ 8 - 0
gencpp.ml

@@ -2026,6 +2026,14 @@ let find_referenced_types 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;
+				| TConst TSuper ->
+                (match expression.etype with
+	             | TInst (klass,params) ->
+                   (try let construct_type = Hashtbl.find constructor_deps klass.cl_path in
+					      visit_type construct_type.cf_type
+                   with Not_found -> () )
+                | _ -> print_endline ("TSuper : Odd etype?")
+                )
 				| _ -> ()
 			);
 			Type.iter visit_expression expression;