Very nice article Stefan and the way you used Slice to avoid the copy is amazing !
Speaking of bugs, I found two drawback related to using open array param:
First, I already wrote on this forum a topic about unnamed type and rtti. Compiler do not generate rtti for an unnamed type ! this is easy to avoid with most types because all what you need to do is to declare the type : type x = xxx. But for open array type that's impossible because the syntax conflicts with dynamic array syntax ! So I suppose there is no official way to have a correct rtti for a function that uses open array param.
Second, On my D10.3, the TArray<T> example caused an "IDE/Compiler not responding" issue that always ends up by IDE restart:
I was able to isolate the line that causes the issue :
MergeSort(Slice(TOpenArray<T>((@values[mid])^), len - mid)); // if I comment this line everything works great !
I tried with different build mode (debug,release) and on different project and the result is always the same