[Xcode 14.0 beta] Key path value type 'NSManagedObjectID' cannot be converted to contextual type 'ID' #390

Closed
opened 2025-12-29 18:26:26 +01:00 by adam · 16 comments
Owner

Originally created by @ptrkstr on GitHub (Jun 13, 2022).

Not sure if this is just a bug with the beta but the source no longer builds in this version of Xcode. Any ideas @JohnEstropia ?
image

image
Originally created by @ptrkstr on GitHub (Jun 13, 2022). Not sure if this is just a bug with the beta but the source no longer builds in this version of Xcode. Any ideas @JohnEstropia ? <img width="1424" alt="image" src="https://user-images.githubusercontent.com/11362913/173425625-7dd3cf94-9db6-48f7-9469-77611e7c13bf.png"> <img width="275" alt="image" src="https://user-images.githubusercontent.com/11362913/173425657-e8e962e3-cd77-4521-9987-eb8dab7ab915.png">
adam added the fixedinvestigating labels 2025-12-29 18:26:26 +01:00
adam closed this issue 2025-12-29 18:26:26 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Jun 14, 2022):

Thanks, I'll go around with the Xcode 14 / iOS 16 changes within the week.

@JohnEstropia commented on GitHub (Jun 14, 2022): Thanks, I'll go around with the Xcode 14 / iOS 16 changes within the week.
Author
Owner

@ptrkstr commented on GitHub (Jun 16, 2022):

Hey @JohnEstropia, I had a little look and these are the changes I found.

  1. MutableCollection.move(fromOffsets:toOffset:) previously had no minimum macOS version but is now macOS 10.15+. First time I've ever seen the same Apple API increase in minimum version. However this change doesn't appear in Apple's diff docs. This was resolved by updating swift-tools-version:5.1 and .macOS(.v10_15). This also applied to other platforms as well.
  2. The error above of Key path value type... seems to indicate that now it's not possible to use namespaced types inside a generic type. Referencing DynamicObject instead of O resolves this but I wish this wasn't necessary.
  3. Xcode warned that there was a place that nil was being checked for even though nil couldn't occur.

I'm hoping that 1 and 2 is reverted by the time RC comes out.
Here is the diff if you'd like to see: https://github.com/JohnEstropia/CoreStore/compare/develop...ptrkstr:develop

@ptrkstr commented on GitHub (Jun 16, 2022): Hey @JohnEstropia, I had a little look and these are the changes I found. 1. `MutableCollection.move(fromOffsets:toOffset:)` previously had no minimum macOS version but is now macOS 10.15+. First time I've ever seen the same Apple API increase in minimum version. However this change doesn't appear in [Apple's diff docs](https://developer.apple.com/documentation/swift/mutablecollection/move(fromoffsets:tooffset:)?changes=latest_major). This was resolved by updating `swift-tools-version:5.1` and `.macOS(.v10_15)`. This also applied to other platforms as well. 1. The error above of `Key path value type...` seems to indicate that now it's not possible to use namespaced types inside a generic type. Referencing `DynamicObject` instead of `O` resolves this but I wish this wasn't necessary. 1. Xcode warned that there was a place that `nil` was being checked for even though `nil` couldn't occur. I'm hoping that 1 and 2 is reverted by the time RC comes out. Here is the diff if you'd like to see: https://github.com/JohnEstropia/CoreStore/compare/develop...ptrkstr:develop
Author
Owner

@JohnEstropia commented on GitHub (Jun 19, 2022):

@ptrkstr Please try this branch out for now while we wait for fixes on (1) from Apple's side: minIOS13.
Note that this branch drops iOS 12 support, since I'm planning to support Swift Structured Concurrency going forward.

(2) had been addressed here. I guess it makes sense that a static typealias should be declared in the protocol itself.

As for (3), the FieldStorableType 's generic type may contain optionals (FieldOptionalType) as well, so nil should be a valid value, but I understand that the compiler now needs a static type for nil. The minIOS13 branch also addresses it here, where luckily any FieldOptionalType can now be used in pattern matching.

@JohnEstropia commented on GitHub (Jun 19, 2022): @ptrkstr Please try this branch out for now while we wait for fixes on (1) from Apple's side: [minIOS13](https://github.com/JohnEstropia/CoreStore/tree/minIOS13). Note that this branch drops iOS 12 support, since I'm planning to support Swift Structured Concurrency going forward. (2) had been addressed [here](https://github.com/JohnEstropia/CoreStore/compare/develop...minIOS13#diff-e4bc45b24c0fbc7419b760bcea24212f120660b1fafe7d2669ccb8633cc9e41eR37). I guess it makes sense that a static `typealias` should be declared in the protocol itself. As for (3), the `FieldStorableType` 's generic type may contain optionals (`FieldOptionalType`) as well, so `nil` should be a valid value, but I understand that the compiler now needs a static type for `nil`. The [minIOS13](https://github.com/JohnEstropia/CoreStore/tree/minIOS13) branch also addresses it [here](https://github.com/JohnEstropia/CoreStore/compare/develop...minIOS13#diff-3f03485f7d5a17dc8b876e5475214d3a8a29be1686a873e3f3e2bc94e076df5aR201), where luckily `any FieldOptionalType` can now be used in pattern matching.
Author
Owner

@ptrkstr commented on GitHub (Jun 22, 2022):

Thanks for getting around to that @JohnEstropia. It looks like it also needs the minimum platform versions updated in the package.swift.
image

@ptrkstr commented on GitHub (Jun 22, 2022): Thanks for getting around to that @JohnEstropia. It looks like it also needs the minimum platform versions updated in the package.swift. <img width="269" alt="image" src="https://user-images.githubusercontent.com/11362913/175000360-180721aa-64d9-4828-95f1-d6872dcc5249.png">
Author
Owner

@JohnEstropia commented on GitHub (Jun 22, 2022):

@ptrkstr I updated Package.swift, sorry about that

@JohnEstropia commented on GitHub (Jun 22, 2022): @ptrkstr I updated Package.swift, sorry about that
Author
Owner

@ptrkstr commented on GitHub (Aug 13, 2022):

Hey @JohnEstropia sorry for the late reply. I've verified it's working with SPM now on the latest beta - Xcode Version 14.0 beta 5 (14A5294e).
Maybe a rebase from develop and it could be good to go?
Looks like it's not backwards compatible with Xcode 13.4.1 however.
image

@ptrkstr commented on GitHub (Aug 13, 2022): Hey @JohnEstropia sorry for the late reply. I've verified it's working with SPM now on the latest beta - Xcode Version 14.0 beta 5 (14A5294e). ~Maybe a rebase from develop and it could be good to go?~ Looks like it's not backwards compatible with Xcode 13.4.1 however. ![image](https://user-images.githubusercontent.com/11362913/184498235-795dc601-be89-404a-8cd9-a53922d0bc2f.png)
Author
Owner

@JohnEstropia commented on GitHub (Aug 16, 2022):

@ptrkstr The latest beta updates are in develop now, and the error you see above is already addressed through a compiler directive: e9219682b5/Sources/Where.swift (L201)

@JohnEstropia commented on GitHub (Aug 16, 2022): @ptrkstr The latest beta updates are in `develop` now, and the error you see above is already addressed through a compiler directive: https://github.com/JohnEstropia/CoreStore/blob/e9219682b52d73dba4d8d561241149c5c5ae2f30/Sources/Where.swift#L201
Author
Owner

@tygore587 commented on GitHub (Sep 8, 2022):

@JohnEstropia Any plans on creating a new release with it soon? We wanted to compile against iOS 16, but don't wanted to use your develop branch as dependency in the project.

@tygore587 commented on GitHub (Sep 8, 2022): @JohnEstropia Any plans on creating a new release with it soon? We wanted to compile against iOS 16, but don't wanted to use your `develop` branch as dependency in the project.
Author
Owner

@JohnEstropia commented on GitHub (Sep 8, 2022):

@tygore587 Yes, Xcode 14 release candidate had been posted today so I'll be preparing a version support soon

@JohnEstropia commented on GitHub (Sep 8, 2022): @tygore587 Yes, Xcode 14 release candidate had been posted today so I'll be preparing a version support soon
Author
Owner

@JohnEstropia commented on GitHub (Sep 13, 2022):

Just released CoreStore 9.0.0. Cheers!

@JohnEstropia commented on GitHub (Sep 13, 2022): Just released CoreStore 9.0.0. Cheers!
Author
Owner

@tygore587 commented on GitHub (Sep 13, 2022):

Thank you :) Anything we need to be aware of while upgrading from 8.1 to 9.0.0? :)

@tygore587 commented on GitHub (Sep 13, 2022): Thank you :) Anything we need to be aware of while upgrading from 8.1 to 9.0.0? :)
Author
Owner

@JohnEstropia commented on GitHub (Sep 13, 2022):

@tygore587 There should be nothing surprising, but Xcode 14 did raise practical minimum development versions (iOS and tvOS 13, watchOS 7.4, macOS 10.15)

@JohnEstropia commented on GitHub (Sep 13, 2022): @tygore587 There should be nothing surprising, but Xcode 14 did raise practical minimum development versions (iOS and tvOS 13, watchOS 7.4, macOS 10.15)
Author
Owner

@tygore587 commented on GitHub (Sep 13, 2022):

@JohnEstropia Okay thank you

@tygore587 commented on GitHub (Sep 13, 2022): @JohnEstropia Okay thank you
Author
Owner

@jonhcbs commented on GitHub (Sep 27, 2022):

is it possible to support ios 12 if using xcode 14?

@jonhcbs commented on GitHub (Sep 27, 2022): is it possible to support ios 12 if using xcode 14?
Author
Owner

@JohnEstropia commented on GitHub (Sep 27, 2022):

@maojoh I'll try to create a separate version (likely 8.2.0) for iOS 12 support, but it would be unmaintained from thereon out because I'm planning to use Combine utilities internally for upcoming updates.

@JohnEstropia commented on GitHub (Sep 27, 2022): @maojoh I'll try to create a separate version (likely `8.2.0`) for iOS 12 support, but it would be unmaintained from thereon out because I'm planning to use Combine utilities internally for upcoming updates.
Author
Owner

@jonhcbs commented on GitHub (Feb 13, 2023):

@JohnEstropia could you help support iOS 12? big thank. since we still need support iOS 12 device

@jonhcbs commented on GitHub (Feb 13, 2023): @JohnEstropia could you help support iOS 12? big thank. since we still need support iOS 12 device
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore-JohnEstropia#390