public static function test(input) {
return (input is Array) ? input[0] : input;
}
Compiler failure for 4.3.0, 4.3.4 and nightly.
[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-alpha.1+2d9ed26; OS type: unix;
| File "src/core/tUnification.ml", line 1274, characters 22-29
| Called from file "src/typing/typer.ml", line 256, characters 15-79
Does not produce error if input or return type are explicitly typed to Dynamic.
With the following code (https://try.haxe.org/#5Ff39D07), which is a real use case when reading json file
Compiler failure for 4.3.0, 4.3.4 and nightly.
Does not produce error if
input
or return type are explicitly typed toDynamic
.