You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OneTo type was introduced keeping OffsetArrays in mind, so that the package may add methods to Base functions such as reshape for AbstractUnitRange arguments, while Base does the same for OneTo. The situation is complicated by StaticArrays adding SOneTo which behaves exactly like a OneTo. The problem with this is that OffsetArrays performs type-piracy, and the behavior of StaticArrays methods might change with OffsetArrays loaded.
The solution to this seems to be to have an AbstractOneTo type in Base, and define the Base methods for AbstractOneTo instead of OneTo. StaticArrays can then subtype AbstractOneTo, and always use Base methods irrespective of whether OffsetArrays is loaded.
The text was updated successfully, but these errors were encountered:
The
OneTo
type was introduced keepingOffsetArrays
in mind, so that the package may add methods toBase
functions such asreshape
forAbstractUnitRange
arguments, whileBase
does the same forOneTo
. The situation is complicated byStaticArrays
addingSOneTo
which behaves exactly like aOneTo
. The problem with this is thatOffsetArrays
performs type-piracy, and the behavior ofStaticArrays
methods might change withOffsetArrays
loaded.The solution to this seems to be to have an
AbstractOneTo
type inBase
, and define theBase
methods forAbstractOneTo
instead ofOneTo
.StaticArrays
can then subtypeAbstractOneTo
, and always useBase
methods irrespective of whetherOffsetArrays
is loaded.The text was updated successfully, but these errors were encountered: