efl-mono: Add extra constructors to Eina.Value
authorXavi Artigas <xavierartigas@yahoo.es>
Fri, 11 Jan 2019 13:28:38 +0000 (14:28 +0100)
committerJiyoun Park <jy0703.park@samsung.com>
Wed, 16 Jan 2019 02:40:19 +0000 (11:40 +0900)
commitd7d71d16e56a1d27c20f845404ffc03884dae8ae
tree065a744b32dcf8e611917a6b9a38697d141ad86f
parentb12673d53490818119a015751460bcb2392cbe09
efl-mono: Add extra constructors to Eina.Value

Summary:
new Eina.Value(0) is a special case. The 0 is silently converted
to an enum (Eina.ValueType) and therefore the call is ambiguous
with the 0 being first converted to an Eina.Value via the implicit
conversion operator (calling the Eina.Value deep copy constructor).
Adding constructors for all supported types solves the problem because
they have higher priority. Also, they avoid one deep copy of the
Eina.Value.

Includes test case to catch this problem in the future. This was discovered
in the tutorials, where new Eina.Value(0) is being used.

Test Plan:
The src/efl_reference_core_event.exe example from the examples repo was
not compiling before, and now it is.
make check and make examples still work as expected.

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7598
src/bindings/mono/eina_mono/eina_value.cs
src/tests/efl_mono/ValueEolian.cs