Doing a pointer assignment to another pointer which is a derived type component
could result in the bound information being lost, potentially leading to
incorrect array accesses. Fix this by trying to retain the bound info during
the assignment.
Fixes #57441
I'm not sure what to do about the explicitParams field in the BoxValue constructor below. For the lbounds, grabbing the bounds from the original array and dropping them if we are taking a slice seems correct to me, but this doesn't seem right for the explicitParams/lens. Should I be trying to add the lengths of the slice or something else? I guess always dropping the info would be "safe" in the sense that that was the previous behavior, but I'm not sure what is correct/expected.