Page MenuHomePhabricator

efl-mono: Add extra constructors to Eina.Value
ClosedPublic

Authored by segfaultxavi on Fri, Jan 11, 5:33 AM.

Details

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.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
segfaultxavi created this revision.Fri, Jan 11, 5:33 AM
segfaultxavi requested review of this revision.Fri, Jan 11, 5:33 AM
lauromoura accepted this revision.Fri, Jan 11, 5:50 AM
This revision is now accepted and ready to land.Fri, Jan 11, 5:50 AM
This revision was automatically updated to reflect the committed changes.

And thanks Xavi for the code!