zarray
zarray copied to clipboard
trivial mixed expression throw bad_function call
this throws a bad_function_call and gdb says "no stack" =/.
Failing test is in #62
TEST_CASE("bad_function_call")
{
zdispatcher_t<detail::plus, 2>::init();
auto x0 = xarray<int>::from_shape({2,2});
auto x1 = xarray<int>::from_shape({2,2});
zarray z0(x0);
zarray z1(x1);
auto res = xarray<double>::from_shape({2,2});
zarray zres(res);
zres = x0 + x1;
}
without the explicit init I get a "callback not found" exception as expected
mhh...just realized that the code above does not add the zarrays but the normal xarrays. Still interesting. when I add some more dispatcher-inits I get some other error:
this give a callback not found
TEST_CASE("bad_function_call")
{
zdispatcher_t<detail::plus, 2>::init();
zdispatcher_t<detail::xassign_dummy_functor, 1>::init();
auto x0 = xarray<int>::from_shape({2,2});
auto x1 = xarray<int>::from_shape({2,2});
zarray z0(x0);
zarray z1(x1);
auto res = xarray<double>::from_shape({2,2});
zarray zres(res);
zres = x0 + x1;
}
this also give a callback not found (this time we actually add the zarrays)
TEST_CASE("bad_function_call")
{
zdispatcher_t<detail::plus, 2>::init();
zdispatcher_t<detail::xassign_dummy_functor, 1>::init();
auto x0 = xarray<int>::from_shape({2,2});
auto x1 = xarray<int>::from_shape({2,2});
zarray z0(x0);
zarray z1(x1);
auto res = xarray<double>::from_shape({2,2});
zarray zres(res);
zres = z0 + z1;
}