Przeglądaj źródła

[cs/java] Consider KExpr as Dynamic

Closes #4286
Cauê Waneck 10 lat temu
rodzic
commit
4004d7dc1d
3 zmienionych plików z 16 dodań i 0 usunięć
  1. 1 0
      gencs.ml
  2. 1 0
      genjava.ml
  3. 14 0
      tests/unit/src/unit/issues/Issue4286.hx

+ 1 - 0
gencs.ml

@@ -885,6 +885,7 @@ let configure gen =
 			| TInst( { cl_path = ([], "Enum") }, _ ) -> TInst(ttype,[])
 			| TInst( ({ cl_kind = KTypeParameter _ } as cl), _ ) when erase_generics && not (Meta.has Meta.NativeGeneric cl.cl_meta) ->
 				t_dynamic
+			| TInst({ cl_kind = KExpr _ }, _) -> t_dynamic
 			| TEnum(_, [])
 			| TInst(_, []) -> t
 			| TInst(cl, params) when

+ 1 - 0
genjava.ml

@@ -930,6 +930,7 @@ let configure gen =
 			| TEnum(e,params) -> TEnum(e, List.map (fun _ -> t_dynamic) params)
 			| TInst(c,params) when Meta.has Meta.Enum c.cl_meta ->
 				TInst(c, List.map (fun _ -> t_dynamic) params)
+			| TInst({ cl_kind = KExpr _ }, _) -> t_dynamic
 			| TInst _ -> t
 			| TType({ t_path = ([], "Null") }, [t]) when is_java_basic_type (gen.gfollow#run_f t) -> t_dynamic
 			| TType({ t_path = ([], "Null") }, [t]) ->

+ 14 - 0
tests/unit/src/unit/issues/Issue4286.hx

@@ -0,0 +1,14 @@
+package unit.issues;
+
+class Issue4286<Const> extends Test
+{
+	public function test()
+	{
+		t(true);
+		var s:Something<10> = null;
+	}
+}
+
+interface Something<Const>
+{
+}