From 1c71a0e19fa2342e64c451a1bda298048ed58140 Mon Sep 17 00:00:00 2001 From: Zeta <53486764+Apprentice-Alchemist@users.noreply.github.com> Date: Thu, 25 Jul 2024 14:29:40 +0200 Subject: [PATCH] [hl] Fix weird compiler error (#11690) --- src/generators/hl2c.ml | 2 +- tests/misc/hl/projects/Issue11689/Main.hx | 2 ++ tests/misc/hl/projects/Issue11689/compile.hxml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/misc/hl/projects/Issue11689/Main.hx create mode 100644 tests/misc/hl/projects/Issue11689/compile.hxml diff --git a/src/generators/hl2c.ml b/src/generators/hl2c.ml index ced5dd506e6..efd7f6bacd6 100644 --- a/src/generators/hl2c.ml +++ b/src/generators/hl2c.ml @@ -1169,7 +1169,7 @@ let make_types_idents htypes = in let hashes = Hashtbl.create 0 in let make_sign d = - let dig = Digest.to_hex (Digest.bytes (Marshal.to_bytes d [Marshal.Compat_32])) in + let dig = Digest.to_hex (Digest.bytes (Marshal.to_bytes d [Marshal.Closures])) in let h = String.sub dig 0 7 in let h = if Hashtbl.mem hashes h then dig else h in Hashtbl.add hashes h (); diff --git a/tests/misc/hl/projects/Issue11689/Main.hx b/tests/misc/hl/projects/Issue11689/Main.hx new file mode 100644 index 00000000000..f641935105d --- /dev/null +++ b/tests/misc/hl/projects/Issue11689/Main.hx @@ -0,0 +1,2 @@ +function foo(val:hl.Ref) {} +function main() {} \ No newline at end of file diff --git a/tests/misc/hl/projects/Issue11689/compile.hxml b/tests/misc/hl/projects/Issue11689/compile.hxml new file mode 100644 index 00000000000..0af07fc89cf --- /dev/null +++ b/tests/misc/hl/projects/Issue11689/compile.hxml @@ -0,0 +1,2 @@ +-m Main +-hl out/main.c \ No newline at end of file