haxe icon indicating copy to clipboard operation
haxe copied to clipboard

[js] haxe.Rest argument in inline new, compiler error

Open PXshadow opened this issue 7 months ago • 2 comments

class Test {
	static function main() {
		new S<Int>(10,10);
	}
}

class S<T> {
	public inline function new(x:Int, y:Int, z:haxe.Rest<T>) {}
}

Tested on latest Haxe https://try.haxe.org/#7a11F6b3

PXshadow avatar Apr 29 '25 18:04 PXshadow

What compiler error? I can only see a warning (will need to update try haxe default defines to avoid it)

Edit: ok, after reading the other issue it seems like the error is for js target (which is not the selected target in your link)

[ERROR] Test.hx:3: characters 3-20

 3 |   new S<Int>(10,10);
   |   ^^^^^^^^^^^^^^^^^
   | (x : Int, y : Int, z : haxe.Rest<Int>) -> Void should be (Int, Int) -> Void

kLabz avatar May 06 '25 06:05 kLabz

My bad on the incorrect target link.

PXshadow avatar May 06 '25 11:05 PXshadow