diff --git a/src/codegen/gencommon/enumToClass2.ml b/src/codegen/gencommon/enumToClass2.ml index 100d131d262..1c4ebef2a43 100644 --- a/src/codegen/gencommon/enumToClass2.ml +++ b/src/codegen/gencommon/enumToClass2.ml @@ -85,7 +85,7 @@ module EnumToClass2Modf = struct let e_pack, e_name = en.e_path in let cl_enum_t = TInst (cl_enum, []) in let cf_getTag_t = tfun [] basic.tstring in - let cf_getParams_ret = basic.tarray basic.tstring in + let cf_getParams_ret = basic.tarray (mk_anon PMap.empty) in let cf_getParams_t = tfun [] cf_getParams_ret in let static_ctors = ref [] in let ctors_map = ref PMap.empty in diff --git a/src/generators/gencs.ml b/src/generators/gencs.ml index 9166845526c..8c723154ab5 100644 --- a/src/generators/gencs.ml +++ b/src/generators/gencs.ml @@ -918,6 +918,7 @@ let generate con = Null<> type parameters will be transformed into Dynamic. *) | true, TInst ( { cl_path = (["haxe";"lang"], "Null") }, _ ) -> dynamic_anon + | true, TInst ( { cl_path = ([], "String") }, _ ) -> t | true, TInst ( { cl_kind = KTypeParameter _ }, _ ) -> t | true, TInst _ | true, TEnum _ diff --git a/tests/misc/projects/Issue5434/Main.hx b/tests/misc/projects/Issue5434/Main.hx new file mode 100644 index 00000000000..bca478825cc --- /dev/null +++ b/tests/misc/projects/Issue5434/Main.hx @@ -0,0 +1,6 @@ +interface ITest { + function keys():Array; + function values():Array; +} + +interface ISubTest extends ITest {} diff --git a/tests/misc/projects/Issue5434/compile.hxml b/tests/misc/projects/Issue5434/compile.hxml new file mode 100644 index 00000000000..62d1ab5ddc1 --- /dev/null +++ b/tests/misc/projects/Issue5434/compile.hxml @@ -0,0 +1,2 @@ +Main +-cs bin diff --git a/tests/misc/projects/Issue8361/Main.hx b/tests/misc/projects/Issue8361/Main.hx new file mode 100644 index 00000000000..29174479e76 --- /dev/null +++ b/tests/misc/projects/Issue8361/Main.hx @@ -0,0 +1,22 @@ +class SortedStringMapImpl extends haxe.ds.BalancedTree implements haxe.Constraints.IMap { + + var cmp:String -> String -> Int; + + public function new(?comparator:String -> String -> Int) { + super(); + this.cmp = comparator == null ? haxe.Utf8.compare : comparator; + } + + override + function compare(s1:String, s2:String):Int { + return cmp(s1, s2); + } +} + +class Main { + static function main() { + var m = new SortedStringMapImpl(); + m.set("foo", "bar"); + trace(m); + } +} diff --git a/tests/misc/projects/Issue8361/compile.hxml b/tests/misc/projects/Issue8361/compile.hxml new file mode 100644 index 00000000000..144577b504c --- /dev/null +++ b/tests/misc/projects/Issue8361/compile.hxml @@ -0,0 +1,2 @@ +-main Main +-cs bin