I updated my iOS app from Swift 5 to Swift 6, and the build fails due to this error in the generated +Schema.swift files:
/Users/concaveusr/Projects/Kanai/Kanai/AmplifyModels/KanaiUserInfo+Schema.swift:23:21 Static property 'schema' is not concurrency-safe because non-'Sendable' type 'ModelSchema' may have shared mutable state
Note that putting @preconcurrency at the top of the generated Schema files suppresses the error, but I'm creating this issue to either add that automatically, or to even better find a way to make schema concurrency-safe.
Reproduction steps
Make any model in Amplify Gen 2 and put it in your Swift 6 Xcode project and try to build it.
Environment information
Describe the bug
I updated my iOS app from Swift 5 to Swift 6, and the build fails due to this error in the generated +Schema.swift files:
Note that putting @preconcurrency at the top of the generated Schema files suppresses the error, but I'm creating this issue to either add that automatically, or to even better find a way to make schema concurrency-safe.
Reproduction steps
Make any model in Amplify Gen 2 and put it in your Swift 6 Xcode project and try to build it.