Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler failure tUnification unknown position #11684

Closed
yuxiaomao opened this issue Jun 4, 2024 · 0 comments
Closed

Compiler failure tUnification unknown position #11684

yuxiaomao opened this issue Jun 4, 2024 · 0 comments

Comments

@yuxiaomao
Copy link
Contributor

With the following code (https://try.haxe.org/#5Ff39D07), which is a real use case when reading json file

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.

@Simn Simn closed this as completed in cc105eb Jun 4, 2024
@kLabz kLabz added this to the 4.3 Hotfix milestone Jun 4, 2024
kLabz pushed a commit that referenced this issue Jun 28, 2024
@kLabz kLabz mentioned this issue Jul 18, 2024
kLabz pushed a commit that referenced this issue Jul 18, 2024
@kLabz kLabz removed this from the 4.3 Hotfix milestone Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants