Antonio Sanchez bb1de9dbde Fix Ref Stride checks.
The existing `Ref` class failed to consider cases where the Ref's
`Stride` setting *could* match the underlying referred object's stride,
but **didn't** at runtime.  This led to trying to set invalid stride values,
causing runtime failures in some cases, and garbage due to mismatched
strides in others.

Here we add the missing runtime checks.  This involves computing the
strides necessary to align with the referred object's storage, and
verifying we can actually set those strides at runtime.

In the `const` case, if it *may* be possible to refer to the original
storage at compile-time but fails at runtime, then we defer to the
`construct(...)` method that makes a copy.

Added more tests to check these cases.

Fixes #2093.
2021-01-05 10:41:25 -08:00
..
2020-12-04 21:45:09 +00:00
2019-03-14 10:08:12 +01:00
2016-05-18 14:03:03 +02:00
2020-12-22 23:25:23 -08:00
2018-11-23 15:37:09 +01:00
2020-12-22 23:25:23 -08:00
2020-12-22 23:25:23 -08:00
2019-12-11 18:22:57 +00:00
2020-12-03 11:27:32 -08:00
2020-06-20 19:16:24 +00:00
2021-01-05 10:41:25 -08:00
2019-01-15 10:51:03 +01:00
2018-11-23 15:12:06 +01:00