Proposed solution
I managed to get around the issue by using Element.scale(by:) in the extension's definition of Array.scale(by:) and not using the * operator.
Using * operator required Element and Double to conform to _VectorMath (which is what we wanted to avoid).
Follow-up on questions and remarks
Just my curiosity, how are you trying to make Array conform to VectorArithmetic? I see them as coefficients of polynomials (as in the algebraic definition). If I am not mistaken, it can be a vector space.
For example, what is your definition of +? Two Arrays may have different sizes. Add coefficients pairwise; and if one array is shorter than the other one, use AdditiveArithmetic.zero for the "missing" element.
> What is _VectorMath protocol? Not documented publicly. I did not see this sooner, but if I option-click on the _VectorMath, there's the quick help:
SummaryAdds the “vector space” numeric operations for any type that conforms to Animatable. #### Declaration protocol _VectorMath : Animatable I am not sure what to make of this. But as you suggested I'd try not to use this "private" (?) API.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: