pothosware / PothosCore

The Pothos data-flow framework
https://github.com/pothosware/PothosCore/wiki
Boost Software License 1.0
302 stars 48 forks source link

Cannot convert Object of type long long to long #217

Closed ncorgan closed 3 years ago

ncorgan commented 3 years ago

"long long" declaration: https://github.com/pothosware/PothosCore/blob/master/lib/Object/Builtin/ConvertIntegers.cpp#L9 Macro: https://github.com/pothosware/PothosCore/blob/master/lib/Object/Builtin/ConvertCommonImpl.hpp#L152 "long" typedef: https://github.com/pothosware/PothosCore/blob/master/lib/Object/Builtin/ConvertCommonImpl.hpp#L26

In theory, with this, conversion should be supported between "long long" and "long", but it errors out.

guruofquality commented 3 years ago

like this fails for you?

POTHOS_TEST_BLOCK("/object/tests", test_long_long_to_long)
{
    Pothos::Object obj((long long)1234);
    auto out = obj.convert<long>();
    printf("out = %d\n", (int)out);
}
ncorgan commented 3 years ago

Closing issue. Taking another look at the error message, it's from Object::extract(), where the type has to be exact.