HaxeFoundation / HaxeFoundation/haxe

Generated .cpp files have conversion errors: "cannot convert from 'String' to 'Float'"

Open
#11,235 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

When building projects for Windows targets, Haxe code which concatenates arbitrary values into strings produces invalid .cpp output with errors:

Example `.hx` input:

```
var choices = new Array();
choices.push("(" + choice + ")");
```

Resulting `.cpp` output:

```
HXLINE( 204) Float floatA = HX_("(",28,00,00,00);
HXDLIN( 204) Float floatB = ( (Float)(choice) );
HXDLIN( 204) _hx_tmp1 = (floatA + floatB);
```

Error:

```
./src/DialogTree.cpp(287): error C2440: 'initializing': cannot convert from 'String' to 'Float'
./src/DialogTree.cpp(287): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.