Jens
June 1, 2019, 9:13pm
3
I'll take a wild guess and say that this has probably something to do with operators on generic types, which has become a lot slower to compile in Swift 5, related threads:
The following is too complex for Xcode 10.2.1:
let u = SIMD2<Float>(0, 1)
let v = SIMD2<Float>(1, 2)
let r = [ // ERROR: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
2*u + 3*v,
4*u + 5*v
]
I've described the same problem in another thread and reported it as SR-10461 , but this thread is an attempt to present it more clearly to try and gain some attention and priority.
Our projects use a lot of SIMD…
I know for certain that the three lines with i, j and k in test.swift did type check (quickly) prior to upgrading to Xcode 10.2 and macOS 10.14.4. But the compiler is now unable to type check them in reasonable time (i takes forever).
test.swift:
import simd
func test(_ p0: float2, _ p1: float2, _ p2: float2, _ p3: float2) {
let i = 3*(-p0 + 3*p1) - (3*p2 + p3)
let j = 6*(p0 - 2*p1 + p2)
let k = 3*(p1 - p0)
print(i, j, k)
}
test(float2(0.1, 1.2), float2(2.3, 3.4), float2(4.5, …
1 Like