haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Inline overload kills server with recursive call

Open RblSb opened this issue 2 years ago • 5 comments

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);
	}
}

RblSb avatar May 19 '23 18:05 RblSb

What do you expect there?

kLabz avatar May 19 '23 18:05 kLabz

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.

RblSb avatar May 19 '23 18:05 RblSb

There is? https://try.haxe.org/#DF0742F3 But yeah, would be nice if server wouldn't crash..

kLabz avatar May 19 '23 18:05 kLabz

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

RblSb avatar May 19 '23 18:05 RblSb

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.

Simn avatar May 30 '23 06:05 Simn