Fix UnknownArrayHandle::CastAndCall for special arrays

`UnknownArrayHandle` treats a `ArrayHandleCast` and
`ArrayHandleMultiplexer` special. When you put one of these arrays in an
`UnknownArrayHandle`, it takes the original array out and stores it. If
you try to take an array of that type out, it will again do the proper
conversion.

The only problem is that if you use `IsType`, the result can be
unexpected. This is what happened with `CastAndCall`, which was using
`IsType` internally. Changed that to `CanConvert` to properly get the
array handle out.
This commit is contained in:
Kenneth Moreland 2021-04-02 12:24:50 -06:00
parent 68f39b86a8
commit b4ef9fcac3

@ -916,7 +916,7 @@ struct UnknownArrayHandleTry
Args&&... args) const
{
using DerivedArrayType = vtkm::cont::ArrayHandle<T, S>;
if (!called && unknownArray.IsType<DerivedArrayType>())
if (!called && unknownArray.CanConvert<DerivedArrayType>())
{
called = true;
DerivedArrayType derivedArray;