HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.14k stars 656 forks source link

Hashlink - Passing default Single args results in 0 #11647

Closed rushmobius closed 4 months ago

rushmobius commented 5 months ago

The following code will output ignoring the default values for b and c. Changing it to Float works as expected

Test.hx:8: 10.000000000 0.000000000 0.000000000
class Test {
  static function main() {
    test(10);
  }

  public static function test(a:Single = 0, b:Single = 1.0, c:Single = 2.0):Void
  {
    trace('$a $b $c');
  }
}
rushmobius commented 5 months ago

Oddly enough, if i wrap them as b:Null<Single> = 1.0, then it works as well, though I don't want null to be an option from a typing perspective