I have a few separate arrays that I am trying to combine. When I have more than 4 arrays that I try to combine, it does not build and only gives the error The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions. I have tried it multiple different ways and am sure that it is only when I attempt to combine more than 4 arrays. Here is how I combine them:
For example let's say these are my arrays:
var a = [1, 2, 3, 4]
var b = [4, 6, 8, 10]
var c = [2, 4, 6, 8]
var d = [3, 6, 9, 12]
var e = [1, 3, 5, 7]
Then I combine them and sort like this:
This works:
(a+b+c+d).sorted { $0.name < $1.name }
But this does not and causes the build to fail:
(a+b+c+d+e).sorted { $0.name < $1.name }
Is there a different way that I should go about combining these arrays to support the combination of more than 4?
bodyof a SwiftUI view, or...?Chain5and submit for inclusion inAlgorithms. github.com/apple/swift-algorithms/blob/main/Guides/Chain.md