HaxeFoundation / HaxeFoundation/hxcpp
'Array<Dynamic>::Array' : ambiguous call to overloaded function
- Dominant language
- C++
- Stars
- 330
- Forks
- 227
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 18
Description
This only happens when the ```--no-opt``` flag is set, so probably not that big an issue.
* Haxe Compiler 3.4.2 (git build master @ 890f8c7)
* hxcpp 3.4.188
* vs2013
* windows 10
### Main.hx
```haxe
import haxe.io.Input;
class Main {
public static function main() {
var models = IO.readModels(null);
trace(models);
}
}
@:structInit
private class Model {
public var f: Float;
}
@:structInit
private class Models {
public var models: Array;
}
private class IOUtils {
public static function fromPatch( i: Input, patchVersion: Int, defaultValue: T, cb: Void -> T )
return i.readInt32() >= patchVersion
? cb()
: defaultValue;
}
private class IO {
public static function readModels( input: Input ) : Models
return {
models: IOUtils.fromPatch(input, 17, [], _readModels.bind(input)),
}
static function _readModels( input: Input )
return [for (i in 0...input.readInt32()) readModel(input)];
static function readModel( input: Input ) : Model
return {
f: input.readFloat(),
}
}
```
### build.hxml
```sh
-cp Sources
-main Main
-cpp cpp-out
--no-opt
```
### haxe build.hxml
```sh
...
Compiling group: haxe
cl.exe -Iinclude -nologo /WX- /fp:precise -DHX_WINDOWS -D_USING_V120_SDK71_ -GR -O2(optim-std) -Zi(debug) -FdC:\xxx\cpp-out\obj/msvc18xp/vc.pdb
(debug) -Od(debug) -O2(release) -Os(optim-size) -FS -Oy- -c -EHs -GS- -arch:SSE2 -IC:/Users/dklein/AppData/Roaming/haxe/haxelib/hxcpp/3,4,188/include -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_AP
I_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 ... tags=[haxe,static]
- src/_Main/IO.cpp
Error: IO.cpp
./src/_Main/IO.cpp(46) : error C2668: 'Array::Array' : ambiguous call to overloaded function
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(980): could be 'Array::Array(const cpp::Variant &)'
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(979): or 'Array::Array(const cpp::ArrayBase &)'
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(978): or 'Array::Array(const Dynamic &)'
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(926): or 'Array::Array(const cpp::VirtualArray &)'
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(899): or 'Array::Array(const Array &)'
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(896): or 'Array::Array(const hx::ObjectPtr> &)'
with
[
ELEM_=Dynamic
]
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(881): or 'Array::Array(Array_obj )'
with
[
ELEM_=Dynamic
]
c:\users\dklein\appdata\roaming\haxe\haxelib\hxcpp\3,4,188\include\Array.h(880): or 'Array::Array(const null &)'
while trying to match the argument list '(hx::ObjectPtr<_Main::Models_obj>)'
Error: Build failed
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.