2
0
Эх сурвалжийг харах

[java] Make sure that the class instances have priorty over abstracts

Closes #6598
Caue Waneck 7 жил өмнө
parent
commit
c848dca2a1

+ 6 - 1
src/codegen/gencommon/gencommon.ml

@@ -550,7 +550,12 @@ let new_ctx con =
 			| TClassDecl cl -> Hashtbl.add types cl.cl_path mt
 			| TEnumDecl e -> Hashtbl.add types e.e_path mt
 			| TTypeDecl t -> Hashtbl.add types t.t_path mt
-			| TAbstractDecl a -> Hashtbl.add types a.a_path mt
+			| TAbstractDecl a ->
+				(* There are some cases where both an abstract and a class
+				   have the same name (e.g. java.lang.Double/Integer/etc)
+				   in this case we generally want the class to have priority *)
+				if not (Hashtbl.mem types a.a_path) then
+					Hashtbl.add types a.a_path mt
 	) con.types;
 
 	let get_type path =