HaxeFoundation / HaxeFoundation/haxe
[cpp] extern class with default args generates null args
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Extern classes with default args seem to generate `null()` for unspecified args in the generated C++.
As an example, for the function signature
``` Haxe
public function func(a:Int, b:Int = 1, c:cpp.Float32 = 1.0):Void;
```
and a function call
``` Haxe
e.func(10);
```
Haxe will generate the C++ of
``` c++
e->func((int)10,null(),null());
```
Full example, though the actual C++ will not build:
``` Haxe
package;
extern class ExternClass {
public function func(a:Int, b:Int = 1, c:cpp.Float32 = 1.0):Void;
}
class Main {
public static function main() {
}
public function test(e:ExternClass):Void {
e.func(10);
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.