haxe
haxe copied to clipboard
Inline overload kills server with recursive call
class Main {
static function main() {}
public function new() {
this.add({id: 0});
}
extern inline overload function add(s:{id:Int}):Void {
// `s` argument kills server
add(s);
}
}
What do you expect there?
Not a compilation server crash, when you typo some code and save file, i think. Maybe recursion can be detected. There is also no compiler errors at all, it seems.
There is? https://try.haxe.org/#DF0742F3 But yeah, would be nice if server wouldn't crash..
Well, with unknown position this is not really good.
And there is simple segmentation fault compiler error, if you test it with haxe build.hxml, not sure why tryhaxe result is different
I'm seeing a stacktrace here:
Called from file "list.ml", line 92, characters 20-23
Called from file "src/core/texpr.ml", line 224, characters 26-41
Called from file "src/optimization/inline.ml", line 630, characters 11-84
Called from file "src/optimization/inline.ml", line 633, characters 10-34
Called from file "src/optimization/inline.ml", line 869, characters 9-23
Called from file "src/typing/calls.ml", line 73, characters 10-74
Called from file "src/typing/callUnification.ml", line 613, characters 13-26
Called from file "list.ml", line 92, characters 20-23
Called from file "src/core/texpr.ml", line 224, characters 26-41
Called from file "src/optimization/inline.ml", line 630, characters 11-84
Called from file "src/optimization/inline.ml", line 633, characters 10-34
Called from file "src/optimization/inline.ml", line 869, characters 9-23
So ultimately, this comes from maybe_reapply_overload_call. Not sure where and how to catch this right now.