Unsure if this is an Xcode bug or a compiler bug - I suspect the former, but anyway, in a SwiftUI view we have some code similar to:
SomeView().padding(.top, someCondition ? 0 : 24)
This compiles and runs fine in both Xcode 12.5 and 12.4 however it fails to compile when trying to load the SwiftUI preview for this view using the 12.5 RC with the following error:
result values in '? :' expression have mismatching types 'Int' and 'CGFloat'
<snip>
Compiling failed: result values in '? :' expression have mismatching types 'Int' and 'CGFloat'
import SwiftUI
struct S : View {
var body: some View {
EmptyView().padding(.top, true ? 0 : 24)
}
}
With top of tree main and it did type-check just fine. Could it be possible for you to try a snapshot from swift.org to see whether it would reproduce the issue?