mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 21:33:55 +00:00
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:
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;
|
||||
|
Loading…
Reference in New Issue
Block a user