shaps80 / SwiftUIBackports

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS
MIT License
931 stars 59 forks source link

Xcode 14.2 fails to compile version 2.2+ #46

Closed kadaggers closed 1 year ago

kadaggers commented 1 year ago

General Information

Describe the bug

When upgrading to any version past 2.2.0 and trying to build the project on Xcode 14.2, the following error will occur cannot declare local computed variable in result builder which is emitting from the addition of /SwiftUIBackports/Sources/SwiftUIBackports/iOS/AutoCapitalization/AutoCapitalization.swift with this block of code

var type: SwiftUI.TextInputAutocapitalization {
...
}

Steps to reproduce

Try running any version past 2.2 of SwiftUIBackPorts on Xcode 14.2.

Expected behavior

SwiftUIBackports to build correctly

Screenshots

image

Additional context

I believe that this block of #if available code just needs to verify the swift version and this shouldn't be a problem anymore. We're sadly blocked from moving to Xcode 14.3 at our company and a fix in a later version past 2.2 fixed an issue we were having elsewhere. One of our developers had 14.3 on their computer and was working off that, but when it got to our build machines that are still running 14.2, this is when we saw it was failing.