HaxeFoundation / HaxeFoundation/hxcpp

Error: conversion from 'long' to 'const Dynamic' is ambiguous

Open
#621 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

When [compiling SiON](https://github.com/thejustinwalsh/SiON) for macOS (`lime build mac -debug`) I am getting the following compiler error:
```cpp
Error: ./src/org/si/sion/sequencer/base/MMLParser.cpp:756:45: error: conversion from 'long' to 'const Dynamic' is ambiguous
int defaultValue = __o_defaultValue.Default(-2147483648);
^~~~~~~~~~~
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:21:4: note: candidate constructor
Dynamic(int inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:22:4: note: candidate constructor
Dynamic(short inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:23:4: note: candidate constructor
Dynamic(unsigned int inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:24:4: note: candidate constructor
Dynamic(unsigned short inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:25:4: note: candidate constructor
Dynamic(unsigned char inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:26:4: note: candidate constructor
Dynamic(signed char inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:28:4: note: candidate constructor
Dynamic(bool inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:29:4: note: candidate constructor
Dynamic(double inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:30:4: note: candidate constructor
Dynamic(float inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:31:4: note: candidate constructor
Dynamic(cpp::Int64 inVal);
^
/usr/local/lib/haxe/lib/hxcpp/3,4,64/include/Dynamic.h:32:4: note: candidate constructor
Dynamic(cpp::UInt64 inVal);
^
1 error generated.
```

When compiling for iOS (`lime build ios -debug`) the compilation results in a few more warnings, and still fails to compile:
```cpp
warning: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will have type 'long long' in C++11 onwards [-Wc++11-compat]
HXDLIN( 38) INT_MIN_VALUE = (int)-2147483648;
```

Which is generated from the following source:
https://github.com/thejustinwalsh/SiON/blob/master/src/org/si/sion/sequencer/base/MMLParser.hx#L476-L478

Using the definition of `INT_MIN_VALUE`
```haxe
public static inline var INT_MIN_VALUE = -2147483648;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.