scovich commented on issue #8794:
URL: https://github.com/apache/arrow-rs/issues/8794#issuecomment-3517628599

   So I did some pathfinding, and it looks like we have two conflicting 
objectives.
   
   First, there's a desire for "everything possible" to `impl Array` so that 
functions which accept `&dyn Array` Just Work in ~all cases. In particular, 
blanket `impl<T: Array> Array for &T` and `impl Array for Arc<dyn Array>` mean 
that e.g. `&Arc<Arc<dyn Array>>` is an `Array`. Very convenient, but `&T` can 
never `impl Any` and so `Array: Any` is forbidden.
   
   Second, we would like to downcast `Arc<dyn Array>` to e.g. 
`Arc<StructArray>`. But that requires knowing that we have an Arc in the first 
place... which we usually don't because it coerces so easily to `&dyn Array`. 
Or we have a double-arc `Arc<Arc<StructArray>>` which can only be safely 
downcast if unwrapped first.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to