HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.03k stars 648 forks source link

[hlc] Weird compiler error #11689

Open Apprentice-Alchemist opened 3 weeks ago

Apprentice-Alchemist commented 3 weeks ago
function foo(val:hl.Ref<String>) {}

function main() {}

Compile with haxe -m Main -hl out/main.c.

Error message:

 ERROR  (unknown position)

   | Invalid_argument("output_value: functional value")

Tested with commit https://github.com/HaxeFoundation/haxe/commit/c850b652a1f69dbbc0fd903da04419eeda81b225

Stack trace obtained by running with OCAMLRUNPARAM=b

``` Fatal error: exception Invalid_argument("output_value: functional value") Raised by primitive operation at Hl2c.make_types_idents.make_sign in file "src/generators/hl2c.ml", line 1172, characters 40-80 Called from Hl2c.make_types_idents.desc_string in file "src/generators/hl2c.ml", line 1187, characters 14-25 Called from PMap.mapi.loop in file "src/pMap.ml", line 150, characters 16-21 Called from PMap.mapi.loop in file "src/pMap.ml", line 149, characters 12-18 Called from PMap.mapi.loop in file "src/pMap.ml", line 149, characters 12-18 Called from PMap.mapi.loop in file "src/pMap.ml", line 149, characters 12-18 Called from PMap.mapi.loop in file "src/pMap.ml", line 149, characters 12-18 Called from PMap.mapi.loop in file "src/pMap.ml", line 148, characters 12-18 Called from PMap.mapi.loop in file "src/pMap.ml", line 149, characters 12-18 Called from PMap.mapi.loop in file "src/pMap.ml", line 149, characters 12-18 Called from PMap.mapi in file "src/pMap.ml", line 151, characters 21-29 Called from Hl2c.write_c in file "src/generators/hl2c.ml", line 1457, characters 17-41 Called from Genhl.generate in file "src/generators/genhl.ml", line 4291, characters 2-39 Called from Generate.generate in file "src/compiler/generate.ml", line 204, characters 3-15 Called from Compiler.compile in file "src/compiler/compiler.ml", line 403, characters 29-64 Called from Compiler.compile_safe in file "src/compiler/compiler.ml", line 419, characters 1-5 Called from Compiler.compile_safe in file "src/compiler/compiler.ml", line 457, characters 5-23 Called from Compiler.compile_ctx.run in file "src/compiler/compiler.ml", line 497, characters 2-131 Called from Compiler.catch_completion_and_exit in file "src/compiler/compiler.ml", line 471, characters 2-9 Called from Compiler.HighLevel.entry.loop in file "src/compiler/compiler.ml", line 694, characters 5-43 Called from Compiler.HighLevel.entry in file "src/compiler/compiler.ml", line 706, characters 13-22 Called from Server.process in file "src/compiler/server.ml", line 803, characters 1-39 Called from Dune__exe__Haxe in file "src/compiler/haxe.ml", line 53, characters 0-56 ```