Haxe version
5.0.0-preview.1+5f83789
Steps do reproduce
class Main {
static function main() {
var x:Int = 1;
var nb:Null<Bool> = cast x; // compiler failure on HL only
trace(nb);
}
}
Save it inside a src folder, then run haxe -cp src -main Main --hl main.hl on your terminal.
Result
haxe -cp src -main Main --hl main.hl
[ERROR] (unknown position)
| Error: Compiler failure
| Please submit an issue at https://github.com/HaxeFoundation/haxe/issues/new
| Attach the following information:
| Haxe: 5.0.0-preview.1+5f83789; OS type: unix;
| File "src/generators/genhl.ml", line 1289, characters 16-23
| Called from Genhl.cast_to in file "src/generators/genhl.ml", line 1289, characters 9-23
| Called from Genhl.eval_to in file "src/generators/genhl.ml", line 1153, characters 10-25
| Called from Genhl.eval_expr in file "src/generators/genhl.ml", line 1759, characters 12-48
| Called from Genhl.eval_expr.loop in file "src/generators/genhl.ml", line 1798, characters 10-27
| Called from Genhl.eval_expr in file "src/generators/genhl.ml", line 1803, characters 10-17
| Called from Genhl.make_fun in file "src/generators/genhl.ml", line 3445, characters 8-33
| Called from Genhl.generate_static.loop in file "src/generators/genhl.ml", line 3522, characters 45-139
| Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15
| Called from Genhl.generate_type in file "src/generators/genhl.ml", line 3609, characters 2-56
| Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15
| Called from Genhl.generate in file "src/generators/genhl.ml", line 4356, characters 1-24
| Called from Std.finally in file "src/std.ml", line 24, characters 6-9
| Called from Compiler.compile in file "src/compiler/compiler.ml", line 391, characters 29-64
| Called from Compiler.compile_safe in file "src/compiler/compiler.ml", line 410, characters 1-5
| Called from Compiler.compile_safe in file "src/compiler/compiler.ml", line 456, characters 5-23
| Called from Compiler.compile_ctx.run in file "src/compiler/compiler.ml", lines 516-520, characters 2-3
| Called from Compiler.catch_completion_and_exit in file "src/compiler/compiler.ml", line 482, characters 2-9
| Called from HighLevel.entry.loop in file "src/compiler/highLevel.ml", line 88, characters 14-43
| Called from HighLevel.entry in file "src/compiler/highLevel.ml", line 95, characters 12-35
| Called from Dune__exe__Haxe in file "src/compiler/haxe.ml", line 165, characters 15-62
|
While the runtime behavior is inconsistent, only HashLink fails at compile time.
The same code compiles just fine on 4.3.7 for all targets, and on latest Nightly on all all targets except HL.
Haxe version
5.0.0-preview.1+5f83789Steps do reproduce
Save it inside a
srcfolder, then runhaxe -cp src -main Main --hl main.hlon your terminal.Result
While the runtime behavior is inconsistent, only HashLink fails at compile time.
The same code compiles just fine on 4.3.7 for all targets, and on latest Nightly on all all targets except HL.